10 class ApiParseTest
extends ApiTestCase
{
12 protected static $pageId;
13 protected static $revIds = [];
15 public function addDBDataOnce() {
16 $title = Title
::newFromText( __CLASS__
);
18 $status = $this->editPage( __CLASS__
, 'Test for revdel' );
19 self
::$pageId = $status->value
['revision']->getPage();
20 self
::$revIds['revdel'] = $status->value
['revision']->getId();
22 $status = $this->editPage( __CLASS__
, 'Test for suppressed' );
23 self
::$revIds['suppressed'] = $status->value
['revision']->getId();
25 $status = $this->editPage( __CLASS__
, 'Test for oldid' );
26 self
::$revIds['oldid'] = $status->value
['revision']->getId();
28 $status = $this->editPage( __CLASS__
, 'Test for latest' );
29 self
::$revIds['latest'] = $status->value
['revision']->getId();
31 $this->revisionDelete( self
::$revIds['revdel'] );
32 $this->revisionDelete(
33 self
::$revIds['suppressed'],
34 [ Revision
::DELETED_TEXT
=> 1, Revision
::DELETED_RESTRICTED
=> 1 ]
37 Title
::clearCaches(); // Otherwise it has the wrong latest revision for some reason
41 * Assert that the given result of calling $this->doApiRequest() with
42 * action=parse resulted in $html, accounting for the boilerplate that the
43 * parser adds around the parsed page. Also asserts that warnings match
44 * the provided $warning.
46 * @param string $html Expected HTML
47 * @param array $res Returned from doApiRequest()
48 * @param string|null $warnings Exact value of expected warnings, null for
51 protected function assertParsedTo( $expected, array $res, $warnings = null ) {
52 $this->doAssertParsedTo( $expected, $res, $warnings, [ $this, 'assertSame' ] );
56 * Same as above, but asserts that the HTML matches a regexp instead of a
57 * literal string match.
59 * @param string $html Expected HTML
60 * @param array $res Returned from doApiRequest()
61 * @param string|null $warnings Exact value of expected warnings, null for
64 protected function assertParsedToRegExp( $expected, array $res, $warnings = null ) {
65 $this->doAssertParsedTo( $expected, $res, $warnings, [ $this, 'assertRegExp' ] );
68 private function doAssertParsedTo( $expected, array $res, $warnings, callable
$callback ) {
69 $html = $res[0]['parse']['text'];
71 $expectedStart = '<div class="mw-parser-output">';
72 $this->assertSame( $expectedStart, substr( $html, 0, strlen( $expectedStart ) ) );
74 $html = substr( $html, strlen( $expectedStart ) );
76 if ( $res[1]->getBool( 'disablelimitreport' ) ) {
77 $expectedEnd = "</div>";
78 $this->assertSame( $expectedEnd, substr( $html, -strlen( $expectedEnd ) ) );
80 $html = substr( $html, 0, strlen( $html ) - strlen( $expectedEnd ) );
82 $expectedEnd = '#\n<!-- \nNewPP limit report\n(?>.+?\n-->)\n' .
83 '<!--\nTransclusion expansion time report \(%,ms,calls,template\)\n(?>.*?\n-->)\n' .
84 '</div>(\n<!-- Saved in parser cache (?>.*?\n -->)\n)?$#s';
85 $this->assertRegExp( $expectedEnd, $html );
87 $html = preg_replace( $expectedEnd, '', $html );
90 call_user_func( $callback, $expected, $html );
92 if ( $warnings === null ) {
93 $this->assertCount( 1, $res[0] );
95 $this->assertCount( 2, $res[0] );
96 // This deliberately fails if there are extra warnings
97 $this->assertSame( [ 'parse' => [ 'warnings' => $warnings ] ], $res[0]['warnings'] );
102 * Set up an interwiki entry for testing.
104 protected function setupInterwiki() {
105 $dbw = wfGetDB( DB_MASTER
);
109 'iw_prefix' => 'madeuplanguage',
110 'iw_url' => "https://example.com/wiki/$1",
119 $this->setMwGlobals( 'wgExtraInterlanguageLinkPrefixes', [ 'madeuplanguage' ] );
120 $this->tablesUsed
[] = 'interwiki';
124 * Set up a skin for testing.
126 * @todo Should this code be in MediaWikiTestCase or something?
128 protected function setupSkin() {
129 $factory = new SkinFactory();
130 $factory->register( 'testing', 'Testing', function () {
131 $skin = $this->getMockBuilder( SkinFallback
::class )
132 ->setMethods( [ 'getDefaultModules', 'setupSkinUserCss' ] )
134 $skin->expects( $this->once() )->method( 'getDefaultModules' )
136 'styles' => [ 'core' => [ 'quux.styles' ] ],
137 'core' => [ 'foo', 'bar' ],
138 'content' => [ 'baz' ]
140 $skin->expects( $this->once() )->method( 'setupSkinUserCss' )
141 ->will( $this->returnCallback( function ( OutputPage
$out ) {
142 $out->addModuleStyles( 'foo.styles' );
146 $this->setService( 'SkinFactory', $factory );
149 public function testParseByName() {
150 $res = $this->doApiRequest( [
154 $this->assertParsedTo( "<p>Test for latest\n</p>", $res );
156 $res = $this->doApiRequest( [
159 'disablelimitreport' => 1,
161 $this->assertParsedTo( "<p>Test for latest\n</p>", $res );
164 public function testParseById() {
165 $res = $this->doApiRequest( [
167 'pageid' => self
::$pageId,
169 $this->assertParsedTo( "<p>Test for latest\n</p>", $res );
172 public function testParseByOldId() {
173 $res = $this->doApiRequest( [
175 'oldid' => self
::$revIds['oldid'],
177 $this->assertParsedTo( "<p>Test for oldid\n</p>", $res );
178 $this->assertArrayNotHasKey( 'textdeleted', $res[0]['parse'] );
179 $this->assertArrayNotHasKey( 'textsuppressed', $res[0]['parse'] );
182 public function testRevDel() {
183 $res = $this->doApiRequest( [
185 'oldid' => self
::$revIds['revdel'],
188 $this->assertParsedTo( "<p>Test for revdel\n</p>", $res );
189 $this->assertArrayHasKey( 'textdeleted', $res[0]['parse'] );
190 $this->assertArrayNotHasKey( 'textsuppressed', $res[0]['parse'] );
193 public function testRevDelNoPermission() {
194 $this->setExpectedException( ApiUsageException
::class,
195 "You don't have permission to view deleted revision text." );
197 $this->doApiRequest( [
199 'oldid' => self
::$revIds['revdel'],
200 ], null, null, static::getTestUser()->getUser() );
203 public function testSuppressed() {
204 $this->setGroupPermissions( 'sysop', 'viewsuppressed', true );
206 $res = $this->doApiRequest( [
208 'oldid' => self
::$revIds['suppressed']
211 $this->assertParsedTo( "<p>Test for suppressed\n</p>", $res );
212 $this->assertArrayHasKey( 'textsuppressed', $res[0]['parse'] );
213 $this->assertArrayHasKey( 'textdeleted', $res[0]['parse'] );
216 public function testNonexistentPage() {
218 $this->doApiRequest( [
220 'page' => 'DoesNotExist',
223 $this->fail( "API did not return an error when parsing a nonexistent page" );
224 } catch ( ApiUsageException
$ex ) {
225 $this->assertTrue( ApiTestCase
::apiExceptionHasCode( $ex, 'missingtitle' ),
226 "Parse request for nonexistent page must give 'missingtitle' error: "
227 . var_export( self
::getErrorFormatter()->arrayFromStatus( $ex->getStatusValue() ), true )
232 public function testTitleProvided() {
233 $res = $this->doApiRequest( [
235 'title' => 'Some interesting page',
236 'text' => '{{PAGENAME}} has attracted my attention',
239 $this->assertParsedTo( "<p>Some interesting page has attracted my attention\n</p>", $res );
242 public function testSection() {
243 $name = ucfirst( __FUNCTION__
);
245 $this->editPage( $name,
246 "Intro\n\n== Section 1 ==\n\nContent 1\n\n== Section 2 ==\n\nContent 2" );
248 $res = $this->doApiRequest( [
254 $this->assertParsedToRegExp( '!<h2>.*Section 1.*</h2>\n<p>Content 1\n</p>!', $res );
257 public function testInvalidSection() {
258 $this->setExpectedException( ApiUsageException
::class,
259 'The "section" parameter must be a valid section ID or "new".' );
261 $this->doApiRequest( [
263 'section' => 'T-new',
267 public function testSectionNoContent() {
268 $name = ucfirst( __FUNCTION__
);
270 $status = $this->editPage( $name,
271 "Intro\n\n== Section 1 ==\n\nContent 1\n\n== Section 2 ==\n\nContent 2" );
273 $this->setExpectedException( ApiUsageException
::class,
274 "Missing content for page ID {$status->value['revision']->getPage()}." );
276 $this->db
->delete( 'revision', [ 'rev_id' => $status->value
['revision']->getId() ] );
278 // Suppress warning in WikiPage::getContentModel
279 Wikimedia\
suppressWarnings();
281 $this->doApiRequest( [
287 Wikimedia\restoreWarnings
();
291 public function testNewSectionWithPage() {
292 $this->setExpectedException( ApiUsageException
::class,
293 '"section=new" cannot be combined with the "oldid", "pageid" or "page" ' .
294 'parameters. Please use "title" and "text".' );
296 $this->doApiRequest( [
303 public function testNonexistentOldId() {
304 $this->setExpectedException( ApiUsageException
::class,
305 'There is no revision with ID 2147483647.' );
307 $this->doApiRequest( [
309 'oldid' => pow( 2, 31 ) - 1,
313 public function testUnfollowedRedirect() {
314 $name = ucfirst( __FUNCTION__
);
316 $this->editPage( $name, "#REDIRECT [[$name 2]]" );
317 $this->editPage( "$name 2", "Some ''text''" );
319 $res = $this->doApiRequest( [
324 // Can't use assertParsedTo because the parser output is different for
326 $this->assertRegExp( "/Redirect to:.*$name 2/", $res[0]['parse']['text'] );
327 $this->assertArrayNotHasKey( 'warnings', $res[0] );
330 public function testFollowedRedirect() {
331 $name = ucfirst( __FUNCTION__
);
333 $this->editPage( $name, "#REDIRECT [[$name 2]]" );
334 $this->editPage( "$name 2", "Some ''text''" );
336 $res = $this->doApiRequest( [
342 $this->assertParsedTo( "<p>Some <i>text</i>\n</p>", $res );
345 public function testFollowedRedirectById() {
346 $name = ucfirst( __FUNCTION__
);
348 $id = $this->editPage( $name, "#REDIRECT [[$name 2]]" )->value
['revision']->getPage();
349 $this->editPage( "$name 2", "Some ''text''" );
351 $res = $this->doApiRequest( [
357 $this->assertParsedTo( "<p>Some <i>text</i>\n</p>", $res );
360 public function testInvalidTitle() {
361 $this->setExpectedException( ApiUsageException
::class, 'Bad title "|".' );
363 $this->doApiRequest( [
369 public function testTitleWithNonexistentRevId() {
370 $this->setExpectedException( ApiUsageException
::class,
371 'There is no revision with ID 2147483647.' );
373 $this->doApiRequest( [
375 'title' => __CLASS__
,
376 'revid' => pow( 2, 31 ) - 1,
380 public function testTitleWithNonMatchingRevId() {
381 $name = ucfirst( __FUNCTION__
);
383 $res = $this->doApiRequest( [
386 'revid' => self
::$revIds['latest'],
387 'text' => 'Some text',
390 $this->assertParsedTo( "<p>Some text\n</p>", $res,
391 'r' . self
::$revIds['latest'] . " is not a revision of $name." );
394 public function testRevId() {
395 $res = $this->doApiRequest( [
397 'revid' => self
::$revIds['latest'],
398 'text' => 'My revid is {{REVISIONID}}!',
401 $this->assertParsedTo( "<p>My revid is " . self
::$revIds['latest'] . "!\n</p>", $res );
404 public function testTitleNoText() {
405 $res = $this->doApiRequest( [
407 'title' => 'Special:AllPages',
410 $this->assertParsedTo( '', $res,
411 '"title" used without "text", and parsed page properties were requested. ' .
412 'Did you mean to use "page" instead of "title"?' );
415 public function testRevidNoText() {
416 $res = $this->doApiRequest( [
418 'revid' => self
::$revIds['latest'],
421 $this->assertParsedTo( '', $res,
422 '"revid" used without "text", and parsed page properties were requested. ' .
423 'Did you mean to use "oldid" instead of "revid"?' );
426 public function testTextNoContentModel() {
427 $res = $this->doApiRequest( [
429 'text' => "Some ''text''",
432 $this->assertParsedTo( "<p>Some <i>text</i>\n</p>", $res,
433 'No "title" or "contentmodel" was given, assuming wikitext.' );
436 public function testSerializationError() {
437 $this->setExpectedException( APIUsageException
::class,
438 'Content serialization failed: Could not unserialize content' );
440 $this->mergeMwGlobalArrayValue( 'wgContentHandlers',
441 [ 'testing-serialize-error' => 'DummySerializeErrorContentHandler' ] );
443 $this->doApiRequest( [
445 'text' => "Some ''text''",
446 'contentmodel' => 'testing-serialize-error',
450 public function testNewSection() {
451 $res = $this->doApiRequest( [
453 'title' => __CLASS__
,
455 'sectiontitle' => 'Title',
459 $this->assertParsedToRegExp( '!<h2>.*Title.*</h2>\n<p>Content\n</p>!', $res );
462 public function testExistingSection() {
463 $res = $this->doApiRequest( [
465 'title' => __CLASS__
,
467 'text' => "Intro\n\n== Section 1 ==\n\nContent\n\n== Section 2 ==\n\nMore content",
470 $this->assertParsedToRegExp( '!<h2>.*Section 1.*</h2>\n<p>Content\n</p>!', $res );
473 public function testNoPst() {
474 $name = ucfirst( __FUNCTION__
);
476 $this->editPage( "Template:$name", "Template ''text''" );
478 $res = $this->doApiRequest( [
480 'text' => "{{subst:$name}}",
481 'contentmodel' => 'wikitext',
484 $this->assertParsedTo( "<p>{{subst:$name}}\n</p>", $res );
487 public function testPst() {
488 $name = ucfirst( __FUNCTION__
);
490 $this->editPage( "Template:$name", "Template ''text''" );
492 $res = $this->doApiRequest( [
495 'text' => "{{subst:$name}}",
496 'contentmodel' => 'wikitext',
497 'prop' => 'text|wikitext',
500 $this->assertParsedTo( "<p>Template <i>text</i>\n</p>", $res );
501 $this->assertSame( "{{subst:$name}}", $res[0]['parse']['wikitext'] );
504 public function testOnlyPst() {
505 $name = ucfirst( __FUNCTION__
);
507 $this->editPage( "Template:$name", "Template ''text''" );
509 $res = $this->doApiRequest( [
512 'text' => "{{subst:$name}}",
513 'contentmodel' => 'wikitext',
514 'prop' => 'text|wikitext',
515 'summary' => 'Summary',
520 'text' => "Template ''text''",
521 'wikitext' => "{{subst:$name}}",
522 'parsedsummary' => 'Summary',
528 public function testHeadHtml() {
529 $res = $this->doApiRequest( [
532 'prop' => 'headhtml',
535 // Just do a rough sanity check
536 $this->assertRegExp( '#<!DOCTYPE.*<html.*<head.*</head>.*<body#s',
537 $res[0]['parse']['headhtml'] );
538 $this->assertArrayNotHasKey( 'warnings', $res[0] );
541 public function testCategoriesHtml() {
542 $name = ucfirst( __FUNCTION__
);
544 $this->editPage( $name, "[[Category:$name]]" );
546 $res = $this->doApiRequest( [
549 'prop' => 'categorieshtml',
552 $this->assertRegExp( "#Category.*Category:$name.*$name#",
553 $res[0]['parse']['categorieshtml'] );
554 $this->assertArrayNotHasKey( 'warnings', $res[0] );
557 public function testEffectiveLangLinks() {
559 $this->setTemporaryHook( 'LanguageLinks',
560 function () use ( &$hookRan ) {
565 $res = $this->doApiRequest( [
567 'title' => __CLASS__
,
568 'text' => '[[zh:' . __CLASS__
. ']]',
569 'effectivelanglinks' => '',
572 $this->assertTrue( $hookRan );
573 $this->assertSame( 'The parameter "effectivelanglinks" has been deprecated.',
574 $res[0]['warnings']['parse']['warnings'] );
578 * @param array $arr Extra params to add to API request
580 private function doTestLangLinks( array $arr = [] ) {
581 $this->setupInterwiki();
583 $res = $this->doApiRequest( array_merge( [
585 'title' => 'Omelette',
586 'text' => '[[madeuplanguage:Omelette]]',
587 'prop' => 'langlinks',
590 $langLinks = $res[0]['parse']['langlinks'];
592 $this->assertCount( 1, $langLinks );
593 $this->assertSame( 'madeuplanguage', $langLinks[0]['lang'] );
594 $this->assertSame( 'Omelette', $langLinks[0]['title'] );
595 $this->assertSame( 'https://example.com/wiki/Omelette', $langLinks[0]['url'] );
596 $this->assertArrayNotHasKey( 'warnings', $res[0] );
599 public function testLangLinks() {
600 $this->doTestLangLinks();
603 public function testLangLinksWithSkin() {
605 $this->doTestLangLinks( [ 'useskin' => 'testing' ] );
608 public function testHeadItems() {
609 $res = $this->doApiRequest( [
611 'title' => __CLASS__
,
613 'prop' => 'headitems',
616 $this->assertSame( [], $res[0]['parse']['headitems'] );
618 '"prop=headitems" is deprecated since MediaWiki 1.28. ' .
619 'Use "prop=headhtml" when creating new HTML documents, ' .
620 'or "prop=modules|jsconfigvars" when updating a document client-side.',
621 $res[0]['warnings']['parse']['warnings']
625 public function testHeadItemsWithSkin() {
628 $res = $this->doApiRequest( [
630 'title' => __CLASS__
,
632 'prop' => 'headitems',
633 'useskin' => 'testing',
636 $this->assertSame( [], $res[0]['parse']['headitems'] );
638 '"prop=headitems" is deprecated since MediaWiki 1.28. ' .
639 'Use "prop=headhtml" when creating new HTML documents, ' .
640 'or "prop=modules|jsconfigvars" when updating a document client-side.',
641 $res[0]['warnings']['parse']['warnings']
645 public function testModules() {
646 $this->setTemporaryHook( 'ParserAfterParse',
647 function ( $parser ) {
648 $output = $parser->getOutput();
649 $output->addModules( [ 'foo', 'bar' ] );
650 $output->addModuleScripts( [ 'baz', 'quuz' ] );
651 $output->addModuleStyles( [ 'aaa', 'zzz' ] );
652 $output->addJsConfigVars( [ 'x' => 'y', 'z' => -3 ] );
655 $res = $this->doApiRequest( [
657 'title' => __CLASS__
,
659 'prop' => 'modules|jsconfigvars|encodedjsconfigvars',
662 $this->assertSame( [ 'foo', 'bar' ], $res[0]['parse']['modules'] );
663 $this->assertSame( [ 'baz', 'quuz' ], $res[0]['parse']['modulescripts'] );
664 $this->assertSame( [ 'aaa', 'zzz' ], $res[0]['parse']['modulestyles'] );
665 $this->assertSame( [ 'x' => 'y', 'z' => -3 ], $res[0]['parse']['jsconfigvars'] );
666 $this->assertSame( '{"x":"y","z":-3}', $res[0]['parse']['encodedjsconfigvars'] );
667 $this->assertArrayNotHasKey( 'warnings', $res[0] );
670 public function testModulesWithSkin() {
673 $res = $this->doApiRequest( [
675 'pageid' => self
::$pageId,
676 'useskin' => 'testing',
680 [ 'foo', 'bar', 'baz' ],
681 $res[0]['parse']['modules'],
686 $res[0]['parse']['modulescripts'],
687 'resp.parse.modulescripts'
690 [ 'foo.styles', 'quux.styles' ],
691 $res[0]['parse']['modulestyles'],
692 'resp.parse.modulestyles'
697 'Property "modules" was set but not "jsconfigvars" or ' .
698 '"encodedjsconfigvars". Configuration variables are necessary for ' .
699 'proper module usage.'
706 public function testIndicators() {
707 $res = $this->doApiRequest( [
709 'title' => __CLASS__
,
711 '<indicator name="b">BBB!</indicator>Some text<indicator name="a">aaa</indicator>',
712 'prop' => 'indicators',
716 // It seems we return in markup order and not display order
717 [ 'b' => 'BBB!', 'a' => 'aaa' ],
718 $res[0]['parse']['indicators']
720 $this->assertArrayNotHasKey( 'warnings', $res[0] );
723 public function testIndicatorsWithSkin() {
726 $res = $this->doApiRequest( [
728 'title' => __CLASS__
,
730 '<indicator name="b">BBB!</indicator>Some text<indicator name="a">aaa</indicator>',
731 'prop' => 'indicators',
732 'useskin' => 'testing',
736 // Now we return in display order rather than markup order
737 [ 'a' => 'aaa', 'b' => 'BBB!' ],
738 $res[0]['parse']['indicators']
740 $this->assertArrayNotHasKey( 'warnings', $res[0] );
743 public function testIwlinks() {
744 $this->setupInterwiki();
746 $res = $this->doApiRequest( [
748 'title' => 'Omelette',
749 'text' => '[[:madeuplanguage:Omelette]][[madeuplanguage:Spaghetti]]',
753 $iwlinks = $res[0]['parse']['iwlinks'];
755 $this->assertCount( 1, $iwlinks );
756 $this->assertSame( 'madeuplanguage', $iwlinks[0]['prefix'] );
757 $this->assertSame( 'https://example.com/wiki/Omelette', $iwlinks[0]['url'] );
758 $this->assertSame( 'madeuplanguage:Omelette', $iwlinks[0]['title'] );
759 $this->assertArrayNotHasKey( 'warnings', $res[0] );
762 public function testLimitReports() {
763 $res = $this->doApiRequest( [
765 'pageid' => self
::$pageId,
766 'prop' => 'limitreportdata|limitreporthtml',
769 // We don't bother testing the actual values here
770 $this->assertInternalType( 'array', $res[0]['parse']['limitreportdata'] );
771 $this->assertInternalType( 'string', $res[0]['parse']['limitreporthtml'] );
772 $this->assertArrayNotHasKey( 'warnings', $res[0] );
775 public function testParseTreeNonWikitext() {
776 $this->setExpectedException( ApiUsageException
::class,
777 '"prop=parsetree" is only supported for wikitext content.' );
779 $this->doApiRequest( [
782 'contentmodel' => 'json',
783 'prop' => 'parsetree',
787 public function testParseTree() {
788 $res = $this->doApiRequest( [
790 'text' => "Some ''text'' is {{nice|to have|i=think}}",
791 'contentmodel' => 'wikitext',
792 'prop' => 'parsetree',
795 // Preprocessor_DOM and Preprocessor_Hash give different results here,
796 // so we'll accept either
798 '#^<root>Some \'\'text\'\' is <template><title>nice</title>' .
799 '<part><name index="1"/><value>to have</value></part>' .
800 '<part><name>i</name>(?:<equals>)?=(?:</equals>)?<value>think</value></part>' .
801 '</template></root>$#',
802 $res[0]['parse']['parsetree']
804 $this->assertArrayNotHasKey( 'warnings', $res[0] );
807 public function testDisableTidy() {
808 $this->setMwGlobals( 'wgTidyConfig', [ 'driver' => 'RemexHtml' ] );
810 // Check that disabletidy doesn't have an effect just because tidying
811 // doesn't work for some other reason
812 $res1 = $this->doApiRequest( [
814 'text' => "<b>Mixed <i>up</b></i>",
815 'contentmodel' => 'wikitext',
817 $this->assertParsedTo( "<p><b>Mixed <i>up</i></b>\n</p>", $res1 );
819 $res2 = $this->doApiRequest( [
821 'text' => "<b>Mixed <i>up</b></i>",
822 'contentmodel' => 'wikitext',
826 $this->assertParsedTo( "<p><b>Mixed <i>up</b></i>\n</p>", $res2 );
829 public function testFormatCategories() {
830 $name = ucfirst( __FUNCTION__
);
832 $this->editPage( "Category:$name", 'Content' );
833 $this->editPage( 'Category:Hidden', '__HIDDENCAT__' );
835 $res = $this->doApiRequest( [
837 'title' => __CLASS__
,
838 'text' => "[[Category:$name]][[Category:Foo|Sort me]][[Category:Hidden]]",
839 'prop' => 'categories',
843 [ [ 'sortkey' => '', 'category' => $name ],
844 [ 'sortkey' => 'Sort me', 'category' => 'Foo', 'missing' => true ],
845 [ 'sortkey' => '', 'category' => 'Hidden', 'hidden' => true ] ],
846 $res[0]['parse']['categories']
848 $this->assertArrayNotHasKey( 'warnings', $res[0] );