4 * @group ContentHandler
6 * ^--- needed, because we do need the database to test link updates
8 class CssContentTest
extends MediaWikiTestCase
{
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>",
53 public function testGetModel() {
54 $content = $this->newContent( 'hello world.' );
56 $this->assertEquals( CONTENT_MODEL_CSS
, $content->getModel() );
59 public function testGetContentHandler() {
60 $content = $this->newContent( 'hello world.' );
62 $this->assertEquals( CONTENT_MODEL_CSS
, $content->getContentHandler()->getModelID() );
65 public static function dataEquals() {
67 array( new CssContent( 'hallo' ), null, false ),
68 array( new CssContent( 'hallo' ), new CssContent( 'hallo' ), true ),
69 array( new CssContent( 'hallo' ), new WikitextContent( 'hallo' ), false ),
70 array( new CssContent( 'hallo' ), new CssContent( 'HALLO' ), false ),
75 * @dataProvider dataEquals
77 public function testEquals( Content
$a, Content
$b = null, $equal = false ) {
78 $this->assertEquals( $equal, $a->equals( $b ) );