3 class CssContentHandlerTest
extends MediaWikiLangTestCase
{
6 * @dataProvider provideMakeRedirectContent
7 * @covers CssContentHandler::makeRedirectContent
9 public function testMakeRedirectContent( $title, $expected ) {
10 $this->setMwGlobals( array(
11 'wgServer' => '//example.org',
12 'wgScript' => '/w/index.php',
14 $ch = new CssContentHandler();
15 $content = $ch->makeRedirectContent( Title
::newFromText( $title ) );
16 $this->assertInstanceOf( 'CssContent', $content );
17 $this->assertEquals( $expected, $content->serialize( CONTENT_FORMAT_CSS
) );
21 * Keep this in sync with CssContentTest::provideGetRedirectTarget()
23 public static function provideMakeRedirectContent() {
24 // @codingStandardsIgnoreStart Generic.Files.LineLength
26 array( 'MediaWiki:MonoBook.css', "/* #REDIRECT */@import url(//example.org/w/index.php?title=MediaWiki:MonoBook.css&action=raw&ctype=text/css);" ),
27 array( 'User:FooBar/common.css', "/* #REDIRECT */@import url(//example.org/w/index.php?title=User:FooBar/common.css&action=raw&ctype=text/css);" ),
28 array( 'Gadget:FooBaz.css', "/* #REDIRECT */@import url(//example.org/w/index.php?title=Gadget:FooBaz.css&action=raw&ctype=text/css);" ),
30 // @codingStandardsIgnoreEnd