本文整理汇总了PHP中RequestContext::setSkin方法的典型用法代码示例。如果您正苦于以下问题:PHP RequestContext::setSkin方法的具体用法?PHP RequestContext::setSkin怎么用?PHP RequestContext::setSkin使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RequestContext
的用法示例。
在下文中一共展示了RequestContext::setSkin方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testMakeResourceLoaderLink
/**
* @dataProvider provideMakeResourceLoaderLink
* @covers OutputPage::makeResourceLoaderLink
* @covers ResourceLoader::makeLoaderImplementScript
* @covers ResourceLoader::makeModuleResponse
* @covers ResourceLoader::makeInlineScript
* @covers ResourceLoader::makeLoaderStateScript
* @covers ResourceLoader::createLoaderURL
*/
public function testMakeResourceLoaderLink($args, $expectedHtml)
{
$this->setMwGlobals(array('wgResourceLoaderDebug' => false, 'wgLoadScript' => 'http://127.0.0.1:8080/w/load.php', 'wgWellFormedXml' => false));
$class = new ReflectionClass('OutputPage');
$method = $class->getMethod('makeResourceLoaderLink');
$method->setAccessible(true);
$ctx = new RequestContext();
$ctx->setSkin(SkinFactory::getDefaultInstance()->makeSkin('fallback'));
$ctx->setLanguage('en');
$out = new OutputPage($ctx);
$rl = $out->getResourceLoader();
$rl->setMessageBlobStore(new NullMessageBlobStore());
$rl->register(array('test.foo' => new ResourceLoaderTestModule(array('script' => 'mw.test.foo( { a: true } );', 'styles' => '.mw-test-foo { content: "style"; }')), 'test.bar' => new ResourceLoaderTestModule(array('script' => 'mw.test.bar( { a: true } );', 'styles' => '.mw-test-bar { content: "style"; }')), 'test.baz' => new ResourceLoaderTestModule(array('script' => 'mw.test.baz( { a: true } );', 'styles' => '.mw-test-baz { content: "style"; }')), 'test.quux' => new ResourceLoaderTestModule(array('script' => 'mw.test.baz( { token: 123 } );', 'styles' => '/* pref-animate=off */ .mw-icon { transition: none; }', 'group' => 'private')), 'test.raw' => new ResourceLoaderTestModule(array('script' => 'mw.test.baz( { token: 123 } );', 'isRaw' => true)), 'test.noscript' => new ResourceLoaderTestModule(array('styles' => '.mw-test-noscript { content: "style"; }', 'group' => 'noscript')), 'test.group.bar' => new ResourceLoaderTestModule(array('styles' => '.mw-group-bar { content: "style"; }', 'group' => 'bar')), 'test.group.foo' => new ResourceLoaderTestModule(array('styles' => '.mw-group-foo { content: "style"; }', 'group' => 'foo'))));
$links = $method->invokeArgs($out, $args);
$actualHtml = implode("\n", $links['html']);
$this->assertEquals($expectedHtml, $actualHtml);
}