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