diff options
author | Alexandre Emsenhuber <ialex@users.mediawiki.org> | 2012-02-12 15:22:01 +0000 |
---|---|---|
committer | Alexandre Emsenhuber <ialex@users.mediawiki.org> | 2012-02-12 15:22:01 +0000 |
commit | 2aecd77a15d2411973b4338e152243d1e95bc268 (patch) | |
tree | 142e2946f3f27f0a4dbbb05a7c1abf28dadd7eb5 /tests/phpunit/includes/TemplateCategoriesTest.php | |
parent | 7e16bd810ffb3b42b0b63e5d3e2a44245ea9847c (diff) | |
download | mediawikicore-2aecd77a15d2411973b4338e152243d1e95bc268.tar.gz mediawikicore-2aecd77a15d2411973b4338e152243d1e95bc268.zip |
* Use WikiPage instead of Article to call doEdit()
* Use a local user object and pass it WikiPage::doEdit()
* User::$mRights is a flat array of permissions, not a 2-D array like $wgGroupPermissions
Notes
Notes:
http://mediawiki.org/wiki/Special:Code/MediaWiki/111303
Diffstat (limited to 'tests/phpunit/includes/TemplateCategoriesTest.php')
-rw-r--r-- | tests/phpunit/includes/TemplateCategoriesTest.php | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/tests/phpunit/includes/TemplateCategoriesTest.php b/tests/phpunit/includes/TemplateCategoriesTest.php index de9d6dc6dc85..416ec867b819 100644 --- a/tests/phpunit/includes/TemplateCategoriesTest.php +++ b/tests/phpunit/includes/TemplateCategoriesTest.php @@ -8,21 +8,19 @@ require dirname( __FILE__ ) . "/../../../maintenance/runJobs.php"; class TemplateCategoriesTest extends MediaWikiLangTestCase { function testTemplateCategories() { - global $wgUser; - $title = Title::newFromText( "Categorized from template" ); - $article = new Article( $title ); - $wgUser = new User(); - $wgUser->mRights['*'] = array( 'createpage', 'edit', 'purge' ); + $page = WikiPage::factory( $title ); + $user = new User(); + $user->mRights = array( 'createpage', 'edit', 'purge' ); - $status = $article->doEdit( '{{Categorising template}}', 'Create a page with a template', 0 ); + $status = $page->doEdit( '{{Categorising template}}', 'Create a page with a template', 0, false, $user ); $this->assertEquals( array() , $title->getParentCategories() ); - $template = new Article( Title::newFromText( 'Template:Categorising template' ) ); - $status = $template->doEdit( '[[Category:Solved bugs]]', 'Add a category through a template', 0 ); + $template = WikiPage::factory( Title::newFromText( 'Template:Categorising template' ) ); + $status = $template->doEdit( '[[Category:Solved bugs]]', 'Add a category through a template', 0, false, $user ); // Run the job queue $jobs = new RunJobs; |