On Tim's request, this change moved getParserOutput() and getSecondaryDataUpdates() from the ContentHandler to the Content interface. Change-Id: Ia654aa8710a242ba5fe7a4eb528e6a6449035f59
44 lines
1.2 KiB
PHP
44 lines
1.2 KiB
PHP
<?php
|
|
|
|
/**
|
|
* @group ContentHandler
|
|
*/
|
|
class CssContentTest extends JavascriptContentTest {
|
|
|
|
public function newContent( $text ) {
|
|
return new CssContent( $text );
|
|
}
|
|
|
|
|
|
public function dataGetParserOutput() {
|
|
return array(
|
|
array("MediaWiki:Test.css", "hello <world>\n", "<pre class=\"mw-code mw-css\" dir=\"ltr\">\nhello <world>\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 ),
|
|
);
|
|
}
|
|
|
|
}
|