parent::setUp();
ResourceLoader::clearCache();
}
+
protected function tearDown() {
parent::tearDown();
ResourceLoader::clearCache();
function ( $op ) {
$op->getContext()->setUser( $this->getTestUser()->getUser() );
} ],
- 'After Squid expiry' =>
+ 'After CDN expiry' =>
[ $lastModified, $lastModified, false,
- [ 'UseSquid' => true, 'SquidMaxage' => 3599 ] ],
+ [ 'UseCdn' => true, 'CdnMaxAge' => 3599 ] ],
'Hook allows cache use' =>
[ $lastModified + 1, $lastModified, true, [],
function ( $op, $that ) {
"<p><b>Bold</b>\n</p>",
], 'No section edit links' => [
[ '== Title ==' ],
- "<h2><span class=\"mw-headline\" id=\"Title\">Title</span></h2>\n",
+ "<h2><span class=\"mw-headline\" id=\"Title\">Title</span></h2>",
],
],
'addWikiTextWithTitle' => [
'<p>* Not a list</p>',
], 'No section edit links' => [
[ '== Title ==' ],
- "<h2><span class=\"mw-headline\" id=\"Title\">Title</span></h2>\n",
+ "<h2><span class=\"mw-headline\" id=\"Title\">Title</span></h2>",
], 'With title at start' => [
[ '* {{PAGENAME}}', true, Title::newFromText( 'Talk:Some page' ) ],
"<ul><li>Some page</li></ul>\n",
// Preferred interface: output is tidied
'SpecialNewimages' => [
[ "<p lang='en' dir='ltr'>\nMy message" ],
- '<p lang="en" dir="ltr">' . "\nMy message\n</p>"
+ '<p lang="en" dir="ltr">' . "\nMy message</p>"
], 'List at start' => [
[ '* List' ],
- "<ul><li>List</li></ul>\n",
+ "<ul><li>List</li></ul>",
], 'List not at start' => [
[ '* <b>Not a list', false ],
'<p>* <b>Not a list</b></p>',
"<p>* Some page</p>",
], 'EditPage' => [
[ "<div class='mw-editintro'>{{PAGENAME}}", true, Title::newFromText( 'Talk:Some page' ) ],
- '<div class="mw-editintro">' . "Some page\n</div>"
+ '<div class="mw-editintro">' . "Some page</div>"
],
],
'wrapWikiTextAsInterface' => [
"<div class=\"wrapperClass\"><p>text\n</p></div>"
], 'Spurious </div>' => [
[ 'wrapperClass', 'text</div><div>more' ],
- "<div class=\"wrapperClass\"><p>text</p><div>more\n</div></div>"
+ "<div class=\"wrapperClass\"><p>text</p><div>more</div></div>"
], 'Extra newlines would break <p> wrappers' => [
[ 'two classes', "1\n\n2\n\n3" ],
"<div class=\"two classes\"><p>1\n</p><p>2\n</p><p>3\n</p></div>"
return [
'List at start of line (content)' => [
[ '* List', true, false ],
- "<div class=\"mw-parser-output\"><ul><li>List</li></ul>\n</div>",
- "<ul><li>List</li></ul>\n",
+ "<div class=\"mw-parser-output\"><ul><li>List</li></ul></div>",
+ "<ul><li>List</li></ul>",
],
'List at start of line (interface)' => [
[ '* List', true, true ],
- "<ul><li>List</li></ul>\n",
+ "<ul><li>List</li></ul>",
],
'List not at start (content)' => [
[ "* ''Not'' list", false, false ],
'No section edit links' => [
[ '== Header ==' ],
'<div class="mw-parser-output"><h2><span class="mw-headline" id="Header">' .
- "Header</span></h2>\n</div>",
- '<h2><span class="mw-headline" id="Header">Header</span></h2>' .
- "\n",
+ "Header</span></h2></div>",
+ '<h2><span class="mw-headline" id="Header">Header</span></h2>',
]
];
}
return [
'List at start of line' => [
[ '* List', true ],
- "<ul><li>List</li></ul>\n",
+ "<ul><li>List</li></ul>",
],
'List not at start' => [
[ "* ''Not'' list", false ],
],
'No section edit links' => [
[ '== Header ==' ],
- '<h2><span class="mw-headline" id="Header">Header</span></h2>' .
- "\n",
+ '<h2><span class="mw-headline" id="Header">Header</span></h2>',
]
];
}
}
public function provideAdaptCdnTTL() {
- global $wgSquidMaxage;
+ global $wgCdnMaxAge;
$now = time();
self::$fakeTime = $now;
return [
'Five minutes from now' => [ [ $now + 300 ], IExpiringStore::TTL_MINUTE ],
'Five minutes ago, initial maxage four minutes' =>
[ [ $now - 300 ], 270, [ 'initialMaxage' => 240 ] ],
- 'A very long time ago' => [ [ $now - 1000000000 ], $wgSquidMaxage ],
+ 'A very long time ago' => [ [ $now - 1000000000 ], $wgCdnMaxAge ],
'Initial maxage zero' => [ [ $now - 300 ], 270, [ 'initialMaxage' => 0 ] ],
'false' => [ [ false ], IExpiringStore::TTL_MINUTE ],
// Single only=scripts load
[
[ 'test.foo', ResourceLoaderModule::TYPE_SCRIPTS ],
- "<script nonce=\"secret\">(window.RLQ=window.RLQ||[]).push(function(){"
+ "<script nonce=\"secret\">(RLQ=window.RLQ||[]).push(function(){"
. 'mw.loader.load("http://127.0.0.1:8080/w/load.php?lang=en\u0026modules=test.foo\u0026only=scripts\u0026skin=fallback");'
. "});</script>"
],
// Private embed (only=scripts)
[
[ 'test.quux', ResourceLoaderModule::TYPE_SCRIPTS ],
- "<script nonce=\"secret\">(window.RLQ=window.RLQ||[]).push(function(){"
+ "<script nonce=\"secret\">(RLQ=window.RLQ||[]).push(function(){"
. "mw.test.baz({token:123});\nmw.loader.state({\"test.quux\":\"ready\"});"
. "});</script>"
],
// Load private module (combined)
[
[ 'test.quux', ResourceLoaderModule::TYPE_COMBINED ],
- "<script nonce=\"secret\">(window.RLQ=window.RLQ||[]).push(function(){"
+ "<script nonce=\"secret\">(RLQ=window.RLQ||[]).push(function(){"
. "mw.loader.implement(\"test.quux@1ev0ijv\",function($,jQuery,require,module){"
. "mw.test.baz({token:123});},{\"css\":[\".mw-icon{transition:none}"
. "\"]});});</script>"
// Load two modules in separate groups
[
[ [ 'test.group.foo', 'test.group.bar' ], ResourceLoaderModule::TYPE_COMBINED ],
- "<script nonce=\"secret\">(window.RLQ=window.RLQ||[]).push(function(){"
+ "<script nonce=\"secret\">(RLQ=window.RLQ||[]).push(function(){"
. 'mw.loader.load("http://127.0.0.1:8080/w/load.php?lang=en\u0026modules=test.group.bar\u0026skin=fallback");'
. 'mw.loader.load("http://127.0.0.1:8080/w/load.php?lang=en\u0026modules=test.group.foo\u0026skin=fallback");'
. "});</script>"