本文整理匯總了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);
}