6 require __DIR__
. "/../../../maintenance/runJobs.php";
8 class TemplateCategoriesTest
extends MediaWikiLangTestCase
{
11 * @covers Title::getParentCategories
13 public function testTemplateCategories() {
14 $title = Title
::newFromText( "Categorized from template" );
15 $page = WikiPage
::factory( $title );
17 $user->mRights
= array( 'createpage', 'edit', 'purge' );
20 new WikitextContent( '{{Categorising template}}' ),
21 'Create a page with a template',
29 , $title->getParentCategories()
32 $template = WikiPage
::factory( Title
::newFromText( 'Template:Categorising template' ) );
34 $template->doEditContent(
35 new WikitextContent( '[[Category:Solved bugs]]' ),
36 'Add a category through a template',
43 JobQueueGroup
::destroySingletons();
45 $jobs->loadParamsAndArgs( null, array( 'quiet' => true ), null );
49 array( 'Category:Solved_bugs' => $title->getPrefixedText() )
50 , $title->getParentCategories()