4 * @group ContentHandler
6 * ^--- needed, because we do need the database to test link updates
8 class CssContentTest
extends JavaScriptContentTest
{
10 protected function setUp() {
15 $user->setName( '127.0.0.1' );
17 $this->setMwGlobals( array(
19 'wgTextModelsToParse' => array(
25 public function newContent( $text ) {
26 return new CssContent( $text );
29 public static function dataGetParserOutput() {
35 "<pre class=\"mw-code mw-css\" dir=\"ltr\">\nhello <world>\n\n</pre>"
40 "/* hello [[world]] */\n",
41 "<pre class=\"mw-code mw-css\" dir=\"ltr\">\n/* hello [[world]] */\n\n</pre>",
54 * @covers CssContent::getModel
56 public function testGetModel() {
57 $content = $this->newContent( 'hello world.' );
59 $this->assertEquals( CONTENT_MODEL_CSS
, $content->getModel() );
63 * @covers CssContent::getContentHandler
65 public function testGetContentHandler() {
66 $content = $this->newContent( 'hello world.' );
68 $this->assertEquals( CONTENT_MODEL_CSS
, $content->getContentHandler()->getModelID() );
71 public static function dataEquals() {
73 array( new CssContent( 'hallo' ), null, false ),
74 array( new CssContent( 'hallo' ), new CssContent( 'hallo' ), true ),
75 array( new CssContent( 'hallo' ), new WikitextContent( 'hallo' ), false ),
76 array( new CssContent( 'hallo' ), new CssContent( 'HALLO' ), false ),
81 * @dataProvider dataEquals
82 * @covers CssContent::equals
84 public function testEquals( Content
$a, Content
$b = null, $equal = false ) {
85 $this->assertEquals( $equal, $a->equals( $b ) );