X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=tests%2Fphpunit%2Fincludes%2FTemplateCategoriesTest.php;h=9359568375f3ea20c4c947b489e1360cd8b0cf41;hb=81667f138435b2c0bae1b6a0da6fa47d7cf90063;hp=b0d17267a056efe1ff34591ab966df933dbf02ab;hpb=8d7c0346307d94c679109a41e1a93fa93c921edf;p=lhc%2Fweb%2Fwiklou.git diff --git a/tests/phpunit/includes/TemplateCategoriesTest.php b/tests/phpunit/includes/TemplateCategoriesTest.php index b0d17267a0..9359568375 100644 --- a/tests/phpunit/includes/TemplateCategoriesTest.php +++ b/tests/phpunit/includes/TemplateCategoriesTest.php @@ -12,7 +12,7 @@ class TemplateCategoriesTest extends MediaWikiLangTestCase { */ public function testTemplateCategories() { $user = new User(); - $user->mRights = array( 'createpage', 'edit', 'purge', 'delete' ); + $user->mRights = [ 'createpage', 'edit', 'purge', 'delete' ]; $title = Title::newFromText( "Categorized from template" ); $page = WikiPage::factory( $title ); @@ -25,7 +25,7 @@ class TemplateCategoriesTest extends MediaWikiLangTestCase { ); $this->assertEquals( - array(), + [], $title->getParentCategories(), 'Verify that the category doesn\'t contain the page before the template is created' ); @@ -43,12 +43,12 @@ class TemplateCategoriesTest extends MediaWikiLangTestCase { // Run the job queue JobQueueGroup::destroySingletons(); $jobs = new RunJobs; - $jobs->loadParamsAndArgs( null, array( 'quiet' => true ), null ); + $jobs->loadParamsAndArgs( null, [ 'quiet' => true ], null ); $jobs->execute(); // Make sure page is in the category $this->assertEquals( - array( 'Category:Solved_bugs' => $title->getPrefixedText() ), + [ 'Category:Solved_bugs' => $title->getPrefixedText() ], $title->getParentCategories(), 'Verify that the page is in the category after the template is created' ); @@ -65,12 +65,12 @@ class TemplateCategoriesTest extends MediaWikiLangTestCase { // Run the job queue JobQueueGroup::destroySingletons(); $jobs = new RunJobs; - $jobs->loadParamsAndArgs( null, array( 'quiet' => true ), null ); + $jobs->loadParamsAndArgs( null, [ 'quiet' => true ], null ); $jobs->execute(); // Make sure page is in the right category $this->assertEquals( - array( 'Category:Solved_bugs_2' => $title->getPrefixedText() ), + [ 'Category:Solved_bugs_2' => $title->getPrefixedText() ], $title->getParentCategories(), 'Verify that the page is in the right category after the template is edited' ); @@ -82,12 +82,12 @@ class TemplateCategoriesTest extends MediaWikiLangTestCase { // Run the job queue JobQueueGroup::destroySingletons(); $jobs = new RunJobs; - $jobs->loadParamsAndArgs( null, array( 'quiet' => true ), null ); + $jobs->loadParamsAndArgs( null, [ 'quiet' => true ], null ); $jobs->execute(); // Make sure the page is no longer in the category $this->assertEquals( - array(), + [], $title->getParentCategories(), 'Verify that the page is no longer in the category after template deletion' );