6 require dirname( __FILE__
) . "/../../../maintenance/runJobs.php";
8 class TemplateCategoriesTest
extends MediaWikiLangTestCase
{
10 function testTemplateCategories() {
13 $title = Title
::newFromText( "Categorized from template" );
14 $article = new Article( $title );
16 $wgUser->mRights
['*'] = array( 'createpage', 'edit', 'purge' );
18 $status = $article->doEdit( '{{Categorising template}}', 'Create a page with a template', 0 );
19 $this->assertEquals( $title->getParentCategories(), array() );
21 $template = new Article( Title
::newFromText( 'Template:Categorising template' ) );
22 $status = $template->doEdit( '[[Category:Solved bugs]]', 'Add a category through a template', 0 );
26 $jobs->loadParamsAndArgs( null, array( 'quiet' => true ), null );
29 $this->assertEquals( $title->getParentCategories(), array( 'Category:Solved_bugs' => $title->getPrefixedText() ) );