Remove unused local variables in tests
[lhc/web/wiklou.git] / tests / phpunit / includes / TemplateCategoriesTest.php
1 <?php
2
3 /**
4 * @group Database
5 */
6 require __DIR__ . "/../../../maintenance/runJobs.php";
7
8 class TemplateCategoriesTest extends MediaWikiLangTestCase {
9
10 function testTemplateCategories() {
11 $title = Title::newFromText( "Categorized from template" );
12 $page = WikiPage::factory( $title );
13 $user = new User();
14 $user->mRights = array( 'createpage', 'edit', 'purge' );
15
16 $page->doEditContent( new WikitextContent( '{{Categorising template}}' ), 'Create a page with a template', 0, false, $user );
17 $this->assertEquals(
18 array()
19 , $title->getParentCategories()
20 );
21
22 $template = WikiPage::factory( Title::newFromText( 'Template:Categorising template' ) );
23 $template->doEditContent( new WikitextContent( '[[Category:Solved bugs]]' ), 'Add a category through a template', 0, false, $user );
24
25 // Run the job queue
26 JobQueueGroup::destroySingletons();
27 $jobs = new RunJobs;
28 $jobs->loadParamsAndArgs( null, array( 'quiet' => true ), null );
29 $jobs->execute();
30
31 $this->assertEquals(
32 array( 'Category:Solved_bugs' => $title->getPrefixedText() )
33 , $title->getParentCategories()
34 );
35 }
36
37 }