$expectedEnd = "</div>";
$this->assertSame( $expectedEnd, substr( $html, -strlen( $expectedEnd ) ) );
+ $unexpectedEnd = '#<!-- \nNewPP limit report|' .
+ '<!--\nTransclusion expansion time report#s';
+ $this->assertNotRegExp( $unexpectedEnd, $html );
+
$html = substr( $html, 0, strlen( $html ) - strlen( $expectedEnd ) );
} else {
$expectedEnd = '#\n<!-- \nNewPP limit report\n(?>.+?\n-->)\n' .
'<!--\nTransclusion expansion time report \(%,ms,calls,template\)\n(?>.*?\n-->)\n' .
- '</div>(\n<!-- Saved in parser cache (?>.*?\n -->)\n)?$#s';
+ '(\n<!-- Saved in parser cache (?>.*?\n -->)\n)?</div>$#s';
$this->assertRegExp( $expectedEnd, $html );
$html = preg_replace( $expectedEnd, '', $html );
$this->assertCount( 1, $res[0] );
} else {
$this->assertCount( 2, $res[0] );
- // This deliberately fails if there are extra warnings
- $this->assertSame( [ 'parse' => [ 'warnings' => $warnings ] ], $res[0]['warnings'] );
+ $this->assertSame( [ 'warnings' => $warnings ], $res[0]['warnings']['parse'] );
}
}
function ( $parser ) {
$output = $parser->getOutput();
$output->addModules( [ 'foo', 'bar' ] );
- $output->addModuleScripts( [ 'baz', 'quuz' ] );
$output->addModuleStyles( [ 'aaa', 'zzz' ] );
$output->addJsConfigVars( [ 'x' => 'y', 'z' => -3 ] );
}
] );
$this->assertSame( [ 'foo', 'bar' ], $res[0]['parse']['modules'] );
- $this->assertSame( [ 'baz', 'quuz' ], $res[0]['parse']['modulescripts'] );
+ $this->assertSame( [], $res[0]['parse']['modulescripts'] );
$this->assertSame( [ 'aaa', 'zzz' ], $res[0]['parse']['modulestyles'] );
$this->assertSame( [ 'x' => 'y', 'z' => -3 ], $res[0]['parse']['jsconfigvars'] );
$this->assertSame( '{"x":"y","z":-3}', $res[0]['parse']['encodedjsconfigvars'] );
'disabletidy' => '',
] );
- $this->assertParsedTo( "<p><b>Mixed <i>up</b></i>\n</p>", $res2 );
+ $this->assertParsedTo( "<p><b>Mixed <i>up</b></i>\n</p>", $res2,
+ 'The parameter "disabletidy" has been deprecated.' );
}
public function testFormatCategories() {