44427ba9b605d05e1fb920b837cca8595a89d7f4
4 * @group ContentHandler
6 * ^--- needed, because we do need the database to test link updates
8 * @FIXME this should not extend JavaScriptContentTest.
10 class CssContentTest
extends JavaScriptContentTest
{
12 protected function setUp() {
17 $user->setName( '127.0.0.1' );
19 $this->setMwGlobals( array(
21 'wgTextModelsToParse' => array(
27 public function newContent( $text ) {
28 return new CssContent( $text );
31 public static function dataGetParserOutput() {
37 "<pre class=\"mw-code mw-css\" dir=\"ltr\">\nhello <world>\n\n</pre>"
42 "/* hello [[world]] */\n",
43 "<pre class=\"mw-code mw-css\" dir=\"ltr\">\n/* hello [[world]] */\n\n</pre>",
56 * @covers CssContent::getModel
58 public function testGetModel() {
59 $content = $this->newContent( 'hello world.' );
61 $this->assertEquals( CONTENT_MODEL_CSS
, $content->getModel() );
65 * @covers CssContent::getContentHandler
67 public function testGetContentHandler() {
68 $content = $this->newContent( 'hello world.' );
70 $this->assertEquals( CONTENT_MODEL_CSS
, $content->getContentHandler()->getModelID() );
74 * Redirects aren't supported
76 public static function provideUpdateRedirect() {
79 '#REDIRECT [[Someplace]]',
80 '#REDIRECT [[Someplace]]',
86 * Override this since CssContent does not support redirects yet
88 public static function provideGetRedirectTarget() {
94 public static function dataEquals() {
96 array( new CssContent( 'hallo' ), null, false ),
97 array( new CssContent( 'hallo' ), new CssContent( 'hallo' ), true ),
98 array( new CssContent( 'hallo' ), new WikitextContent( 'hallo' ), false ),
99 array( new CssContent( 'hallo' ), new CssContent( 'HALLO' ), false ),
104 * @dataProvider dataEquals
105 * @covers CssContent::equals
107 public function testEquals( Content
$a, Content
$b = null, $equal = false ) {
108 $this->assertEquals( $equal, $a->equals( $b ) );