wiki.techinc.nl/tests/phpunit/includes/CssContentTest.php
daniel cbc2014b2d Use integers for content_model and content_format.
Representing content_model and content_format as integers in the
database was suggested by Asher mainly to save space.

This change entails some refactoring and renaming, but no big
change in logic.
2012-05-14 10:22:52 +02:00

44 lines
1.1 KiB
PHP

<?php
/**
* @group ContentHandler
*/
class CssContentTest extends JavascriptContentTest {
public function newContent( $text ) {
return new CssContent( $text );
}
public function dataGetParserOutput() {
return array(
array("hello <world>\n", "<pre class=\"mw-code mw-css\" dir=\"ltr\">\nhello &lt;world&gt;\n\n</pre>\n"),
// @todo: more...?
);
}
# =================================================================================================================
public function testGetModel() {
$content = $this->newContent( "hello world." );
$this->assertEquals( CONTENT_MODEL_CSS, $content->getModel() );
}
public function testGetContentHandler() {
$content = $this->newContent( "hello world." );
$this->assertEquals( CONTENT_MODEL_CSS, $content->getContentHandler()->getModelID() );
}
public function dataEquals( ) {
return array(
array( new CssContent( "hallo" ), null, false ),
array( new CssContent( "hallo" ), new CssContent( "hallo" ), true ),
array( new CssContent( "hallo" ), new WikitextContent( "hallo" ), false ),
array( new CssContent( "hallo" ), new CssContent( "HALLO" ), false ),
);
}
}