From 91e194556c52d2f354344f930419eef2dd6267f0 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Wed, 4 Sep 2013 05:51:59 +0200 Subject: Update to MediaWiki 1.21.2 --- tests/phpunit/includes/TemplateCategoriesTest.php | 37 +++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 tests/phpunit/includes/TemplateCategoriesTest.php (limited to 'tests/phpunit/includes/TemplateCategoriesTest.php') diff --git a/tests/phpunit/includes/TemplateCategoriesTest.php b/tests/phpunit/includes/TemplateCategoriesTest.php new file mode 100644 index 00000000..a793babb --- /dev/null +++ b/tests/phpunit/includes/TemplateCategoriesTest.php @@ -0,0 +1,37 @@ +mRights = array( 'createpage', 'edit', 'purge' ); + + $status = $page->doEditContent( new WikitextContent( '{{Categorising template}}' ), 'Create a page with a template', 0, false, $user ); + $this->assertEquals( + array() + , $title->getParentCategories() + ); + + $template = WikiPage::factory( Title::newFromText( 'Template:Categorising template' ) ); + $status = $template->doEditContent( new WikitextContent( '[[Category:Solved bugs]]' ), 'Add a category through a template', 0, false, $user ); + + // Run the job queue + JobQueueGroup::destroySingletons(); + $jobs = new RunJobs; + $jobs->loadParamsAndArgs( null, array( 'quiet' => true ), null ); + $jobs->execute(); + + $this->assertEquals( + array( 'Category:Solved_bugs' => $title->getPrefixedText() ) + , $title->getParentCategories() + ); + } + +} -- cgit v1.2.3-54-g00ecf