Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F4058064
CssContentHandlerTest.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
CssContentHandlerTest.php
View Options
<?php
use
MediaWiki\Content\CssContent
;
use
MediaWiki\Content\CssContentHandler
;
use
MediaWiki\MainConfigNames
;
use
MediaWiki\Title\Title
;
/**
* @covers \MediaWiki\Content\CssContentHandler
*/
class
CssContentHandlerTest
extends
MediaWikiLangTestCase
{
/**
* @dataProvider provideMakeRedirectContent
*/
public
function
testMakeRedirectContent
(
int
$namespace
,
string
$title
,
$expected
)
{
$this
->
overrideConfigValues
(
[
MainConfigNames
::
Server
=>
'//example.org'
,
MainConfigNames
::
Script
=>
'/w/index.php'
,
]
);
$ch
=
new
CssContentHandler
();
$content
=
$ch
->
makeRedirectContent
(
Title
::
makeTitle
(
$namespace
,
$title
)
);
$this
->
assertInstanceOf
(
CssContent
::
class
,
$content
);
$this
->
assertEquals
(
$expected
,
$content
->
serialize
(
CONTENT_FORMAT_CSS
)
);
}
/**
* Keep this in sync with CssContentTest::provideGetRedirectTarget()
*/
public
static
function
provideMakeRedirectContent
()
{
return
[
[
NS_MEDIAWIKI
,
'MonoBook.css'
,
"/* #REDIRECT */@import url(//example.org/w/index.php?title=MediaWiki:MonoBook.css&action=raw&ctype=text/css);"
],
[
NS_USER
,
'FooBar/common.css'
,
"/* #REDIRECT */@import url(//example.org/w/index.php?title=User:FooBar/common.css&action=raw&ctype=text/css);"
],
[
NS_USER
,
'😂/unicode.css'
,
'/* #REDIRECT */@import url(//example.org/w/index.php?title=User:%F0%9F%98%82/unicode.css&action=raw&ctype=text/css);'
],
];
// phpcs:enable
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Aug 16 2026, 04:29 (12 w, 1 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
45/c5/be2ddd9302c12c5a66625ccdafbe
Default Alt Text
CssContentHandlerTest.php (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment