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