Merge "Fixed dependencies for jquery.collapsibleTabs"
[lhc/web/wiklou.git] / tests / phpunit / includes / CssContentTest.php
1 <?php
2
3 /**
4 * @group ContentHandler
5 *
6 * @group Database
7 * ^--- needed, because we do need the database to test link updates
8 */
9 class CssContentTest extends JavascriptContentTest {
10
11 public function newContent( $text ) {
12 return new CssContent( $text );
13 }
14
15
16 public function dataGetParserOutput() {
17 return array(
18 array(
19 "MediaWiki:Test.css",
20 null,
21 "hello <world>\n",
22 "<pre class=\"mw-code mw-css\" dir=\"ltr\">\nhello &lt;world&gt;\n\n</pre>" ),
23
24 array(
25 "MediaWiki:Test.css",
26 null,
27 "/* hello [[world]] */\n",
28 "<pre class=\"mw-code mw-css\" dir=\"ltr\">\n/* hello [[world]] */\n\n</pre>",
29 array( 'Links' => array( // NOTE: assumes default settings for $wgTextModelsToParse
30 array( 'World' => 0 ) ) ) ),
31
32 // @todo: more...?
33 );
34 }
35
36
37 # =================================================================================================================
38
39 public function testGetModel() {
40 $content = $this->newContent( "hello world." );
41
42 $this->assertEquals( CONTENT_MODEL_CSS, $content->getModel() );
43 }
44
45 public function testGetContentHandler() {
46 $content = $this->newContent( "hello world." );
47
48 $this->assertEquals( CONTENT_MODEL_CSS, $content->getContentHandler()->getModelID() );
49 }
50
51 public function dataEquals( ) {
52 return array(
53 array( new CssContent( "hallo" ), null, false ),
54 array( new CssContent( "hallo" ), new CssContent( "hallo" ), true ),
55 array( new CssContent( "hallo" ), new WikitextContent( "hallo" ), false ),
56 array( new CssContent( "hallo" ), new CssContent( "HALLO" ), false ),
57 );
58 }
59
60 }