* @group ContentHandler
* @group Database
*
- * @note Declare that we are using the database, because otherwise we'll fail in the "databaseless" test run.
- * This is because the LinkHolderArray used by the parser needs database access.
- *
+ * @note Declare that we are using the database, because otherwise we'll fail in
+ * the "databaseless" test run. This is because the LinkHolderArray used by the
+ * parser needs database access.
*/
class ContentHandlerTest extends MediaWikiTestCase {
array( 'hallo', 'MediaWiki:Test.js', null, null, CONTENT_MODEL_JAVASCRIPT, 'hallo', false ),
array( serialize( 'hallo' ), 'Dummy:Test', null, null, "testing", 'hallo', false ),
- array( 'hallo', 'Help:Test', null, CONTENT_FORMAT_WIKITEXT, CONTENT_MODEL_WIKITEXT, 'hallo', false ),
- array( 'hallo', 'MediaWiki:Test.js', null, CONTENT_FORMAT_JAVASCRIPT, CONTENT_MODEL_JAVASCRIPT, 'hallo', false ),
+ array(
+ 'hallo',
+ 'Help:Test',
+ null,
+ CONTENT_FORMAT_WIKITEXT,
+ CONTENT_MODEL_WIKITEXT,
+ 'hallo',
+ false
+ ),
+ array(
+ 'hallo',
+ 'MediaWiki:Test.js',
+ null,
+ CONTENT_FORMAT_JAVASCRIPT,
+ CONTENT_MODEL_JAVASCRIPT,
+ 'hallo',
+ false
+ ),
array( serialize( 'hallo' ), 'Dummy:Test', null, "testing", "testing", 'hallo', false ),
array( 'hallo', 'Help:Test', CONTENT_MODEL_CSS, null, CONTENT_MODEL_CSS, 'hallo', false ),
- array( 'hallo', 'MediaWiki:Test.js', CONTENT_MODEL_CSS, null, CONTENT_MODEL_CSS, 'hallo', false ),
- array( serialize( 'hallo' ), 'Dummy:Test', CONTENT_MODEL_CSS, null, CONTENT_MODEL_CSS, serialize( 'hallo' ), false ),
+ array(
+ 'hallo',
+ 'MediaWiki:Test.js',
+ CONTENT_MODEL_CSS,
+ null,
+ CONTENT_MODEL_CSS,
+ 'hallo',
+ false
+ ),
+ array(
+ serialize( 'hallo' ),
+ 'Dummy:Test',
+ CONTENT_MODEL_CSS,
+ null,
+ CONTENT_MODEL_CSS,
+ serialize( 'hallo' ),
+ false
+ ),
array( 'hallo', 'Help:Test', CONTENT_MODEL_WIKITEXT, "testing", null, null, true ),
array( 'hallo', 'MediaWiki:Test.js', CONTENT_MODEL_CSS, "testing", null, null, true ),
* @dataProvider dataMakeContent
* @covers ContentHandler::makeContent
*/
- public function testMakeContent( $data, $title, $modelId, $format, $expectedModelId, $expectedNativeData, $shouldFail ) {
+ public function testMakeContent( $data, $title, $modelId, $format,
+ $expectedModelId, $expectedNativeData, $shouldFail
+ ) {
$title = Title::newFromText( $title );
try {
Hooks::register( 'testRunLegacyHooks', __CLASS__ . '::dummyHookHandler' );
$content = new WikitextContent( 'test text' );
- $ok = ContentHandler::runLegacyHooks( 'testRunLegacyHooks', array( 'foo', &$content, 'bar' ), false );
+ $ok = ContentHandler::runLegacyHooks(
+ 'testRunLegacyHooks',
+ array( 'foo', &$content, 'bar' ),
+ false
+ );
$this->assertTrue( $ok, "runLegacyHooks should have returned true" );
$this->assertEquals( "TEST TEXT", $content->getNativeData() );
}
/**
- * @return string A string representing the content in a way useful for building a full text search index.
- * If no useful representation exists, this method returns an empty string.
+ * @return string A string representing the content in a way useful for
+ * building a full text search index. If no useful representation exists,
+ * this method returns an empty string.
*/
public function getTextForSearchIndex() {
return '';
}
/**
- * Returns a textual representation of the content suitable for use in edit summaries and log messages.
+ * Returns a textual representation of the content suitable for use in edit
+ * summaries and log messages.
*
* @param int $maxlength Maximum length of the summary text.
* @return string The summary text.
* Returns true if this content is countable as a "real" wiki page, provided
* that it's also in a countable location (e.g. a current revision in the main namespace).
*
- * @param bool $hasLinks if it is known whether this content contains links, provide this information here,
- * to avoid redundant parsing to find out.
+ * @param bool $hasLinks if it is known whether this content contains links,
+ * provide this information here, to avoid redundant parsing to find out.
* @return bool
*/
public function isCountable( $hasLinks = null ) {
*
* @return ParserOutput
*/
- public function getParserOutput( Title $title, $revId = null, ParserOptions $options = null, $generateHtml = true ) {
+ public function getParserOutput( Title $title, $revId = null,
+ ParserOptions $options = null, $generateHtml = true
+ ) {
return new ParserOutput( $this->getNativeData() );
}
}