+
+ // Run the job queue
+ JobQueueGroup::destroySingletons();
+ $jobs = new RunJobs;
+ $jobs->loadParamsAndArgs( null, array( 'quiet' => true ), null );
+ $jobs->execute();
+
+ // Make sure page is in the right category
+ $this->assertEquals(
+ array( 'Category:Solved_bugs_2' => $title->getPrefixedText() ),
+ $title->getParentCategories(),
+ 'Verify that the page is in the right category after the template is edited'
+ );
+
+ // Now delete the template
+ $error = '';
+ $template->doDeleteArticleReal( 'Delete the template', false, 0, true, $error, $user );
+
+ // Run the job queue
+ JobQueueGroup::destroySingletons();
+ $jobs = new RunJobs;
+ $jobs->loadParamsAndArgs( null, array( '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'
+ );
+