072a6b022457d50a41de532de58161bda1797b39
[lhc/web/wiklou.git] / tests / phpunit / includes / CssContentTest.php
1 <?php
2
3 class CssContentTest extends JavascriptContentTest {
4
5 public function newContent( $text ) {
6 return new CssContent( $text );
7 }
8
9
10 public function dataGetParserOutput() {
11 return array(
12 array("hello <world>\n", "<pre class=\"mw-code mw-css\" dir=\"ltr\">\nhello &lt;world&gt;\n\n</pre>\n"),
13 // @todo: more...?
14 );
15 }
16
17
18 # =================================================================================================================
19
20 public function getModelName() {
21 $content = $this->newContent( "hello world." );
22
23 $this->assertEquals( CONTENT_MODEL_JAVASCRIPT, $content->getModelName() );
24 }
25
26 public function getContentHandler() {
27 $content = $this->newContent( "hello world." );
28
29 $this->assertEquals( CONTENT_MODEL_JAVASCRIPT, $content->getContentHandler()->getModelName() );
30 }
31
32 public function dataEquals( ) {
33 return array(
34 array( new CssContent( "hallo" ), null, false ),
35 array( new CssContent( "hallo" ), new CssContent( "hallo" ), true ),
36 array( new CssContent( "hallo" ), new WikitextContent( "hallo" ), false ),
37 array( new CssContent( "hallo" ), new CssContent( "HALLO" ), false ),
38 );
39 }
40
41 }