Merge "(bug 40789) Fixed $wgSecureLogin after-login redirect."
[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("MediaWiki:Test.css", null, "hello <world>\n",
19 "<pre class=\"mw-code mw-css\" dir=\"ltr\">\nhello &lt;world&gt;\n\n</pre>\n"),
20 // @todo: more...?
21 );
22 }
23
24
25 # =================================================================================================================
26
27 public function testGetModel() {
28 $content = $this->newContent( "hello world." );
29
30 $this->assertEquals( CONTENT_MODEL_CSS, $content->getModel() );
31 }
32
33 public function testGetContentHandler() {
34 $content = $this->newContent( "hello world." );
35
36 $this->assertEquals( CONTENT_MODEL_CSS, $content->getContentHandler()->getModelID() );
37 }
38
39 public function dataEquals( ) {
40 return array(
41 array( new CssContent( "hallo" ), null, false ),
42 array( new CssContent( "hallo" ), new CssContent( "hallo" ), true ),
43 array( new CssContent( "hallo" ), new WikitextContent( "hallo" ), false ),
44 array( new CssContent( "hallo" ), new CssContent( "HALLO" ), false ),
45 );
46 }
47
48 }