content: Widen @covers tags in phpunit tests

https://gerrit.wikimedia.org/r/q/owner:Krinkle+is:merged+message:Widen

> Given all called methods are de-facto and liberally claimed, and
> that we keep the coverage limited to the subject class, it maintains
> the spirit and intent by listing the class explicitly instead.
>
> PHPUnit offers a more precise tool when you need it (i.e. when testing
> legacy monster/god classes), but for well-written code, the
> class-wide tag is exactly what you want.
>
> We lose useful coverage and waste valuable time on keeping tags
> accurate through refactors (or worse, forget to do so).
> Tracking tiny per-method details wastes time in realizing (and
> fixing) when people inevitably don't keep them in sync, and time
> lost in finding uncovered code to write tests to realize it was
> already covered but "not yet claimed".

While at it, also fix PHPUnit warnings in CssContentHandlerIntegrationTest
and JavaScriptContentHandlerIntegrationTest about not having any
`@covers` annotations.

Change-Id: I5afd9fe0bca0fa86cc096f6e5e79f2ba1cfbfa77
This commit is contained in:
Timo Tijhof 2024-07-21 19:16:16 +01:00 committed by Krinkle
parent 5348ef519e
commit 64734f61ee
22 changed files with 52 additions and 372 deletions

View file

@ -24,6 +24,7 @@ use Wikimedia\UUID\GlobalIdGenerator;
/**
* @group ContentHandler
* @group Database
* @covers \ContentHandler
*/
class ContentHandlerTest extends MediaWikiIntegrationTestCase {
@ -100,7 +101,6 @@ class ContentHandlerTest extends MediaWikiIntegrationTestCase {
/**
* @dataProvider dataGetDefaultModelFor
* @covers \ContentHandler::getDefaultModelFor
*/
public function testGetDefaultModelFor( $title, $expectedModelId ) {
$title = Title::newFromText( $title );
@ -120,7 +120,6 @@ class ContentHandlerTest extends MediaWikiIntegrationTestCase {
/**
* @dataProvider dataGetLocalizedName
* @covers \ContentHandler::getLocalizedName
*/
public function testGetLocalizedName( $id, $expected ) {
$name = ContentHandler::getLocalizedName( $id );
@ -153,7 +152,6 @@ class ContentHandlerTest extends MediaWikiIntegrationTestCase {
/**
* @dataProvider dataGetPageLanguage
* @covers \ContentHandler::getPageLanguage
*/
public function testGetPageLanguage( $title, $expected ) {
$title = Title::newFromText( $title );
@ -168,9 +166,6 @@ class ContentHandlerTest extends MediaWikiIntegrationTestCase {
$this->assertEquals( $expected, $lang->getCode() );
}
/**
* @covers \ContentHandler::getContentText
*/
public function testGetContentText_Null() {
$this->hideDeprecated( 'ContentHandler::getContentText' );
$content = null;
@ -178,9 +173,6 @@ class ContentHandlerTest extends MediaWikiIntegrationTestCase {
$this->assertSame( '', $text );
}
/**
* @covers \ContentHandler::getContentText
*/
public function testGetContentText_TextContent() {
$this->hideDeprecated( 'ContentHandler::getContentText' );
$content = new WikitextContent( "hello world" );
@ -188,9 +180,6 @@ class ContentHandlerTest extends MediaWikiIntegrationTestCase {
$this->assertEquals( $content->getText(), $text );
}
/**
* @covers \ContentHandler::getContentText
*/
public function testGetContentText_NonTextContent() {
$this->hideDeprecated( 'ContentHandler::getContentText' );
$content = new DummyContentForTesting( "hello world" );
@ -248,7 +237,6 @@ class ContentHandlerTest extends MediaWikiIntegrationTestCase {
/**
* @dataProvider dataMakeContent
* @covers \ContentHandler::makeContent
*/
public function testMakeContent( $data, $title, $modelId, $format,
$expectedModelId, $shouldFail
@ -275,10 +263,7 @@ class ContentHandlerTest extends MediaWikiIntegrationTestCase {
}
/**
* @covers \ContentHandler::getAutosummary
*
* Test if we become a "Created blank page" summary from getAutoSummary if no Content added to
* page.
* getAutoSummary() should set "Created blank page" summary if we save an empy string.
*/
public function testGetAutosummary() {
$this->setContentLang( 'en' );
@ -300,7 +285,6 @@ class ContentHandlerTest extends MediaWikiIntegrationTestCase {
/**
* Test software tag that is added when content model of the page changes
* @covers \ContentHandler::getChangeTag
*/
public function testGetChangeTag() {
$this->overrideConfigValue( MainConfigNames::SoftwareTags, [ 'mw-contentmodelchange' => true ] );
@ -314,17 +298,11 @@ class ContentHandlerTest extends MediaWikiIntegrationTestCase {
$this->assertSame( 'mw-contentmodelchange', $tag );
}
/**
* @covers \ContentHandler::supportsCategories
*/
public function testSupportsCategories() {
$handler = new DummyContentHandlerForTesting( CONTENT_MODEL_WIKITEXT );
$this->assertTrue( $handler->supportsCategories(), 'content model supports categories' );
}
/**
* @covers \ContentHandler::supportsDirectEditing
*/
public function testSupportsDirectEditing() {
$handler = new DummyContentHandlerForTesting( CONTENT_MODEL_JSON );
$this->assertFalse( $handler->supportsDirectEditing(), 'direct editing is not supported' );
@ -353,7 +331,6 @@ class ContentHandlerTest extends MediaWikiIntegrationTestCase {
}
/**
* @covers \ContentHandler::getForModelID
* @dataProvider provideGetModelForID
*/
public function testGetModelForID( $modelId, $handlerClass ) {
@ -363,9 +340,6 @@ class ContentHandlerTest extends MediaWikiIntegrationTestCase {
$this->assertInstanceOf( $handlerClass, $handler );
}
/**
* @covers \ContentHandler::getFieldsForSearchIndex
*/
public function testGetFieldsForSearchIndex() {
$searchEngine = $this->newSearchEngine();
@ -396,9 +370,6 @@ class ContentHandlerTest extends MediaWikiIntegrationTestCase {
return $searchEngine;
}
/**
* @covers \ContentHandler::getDataForSearchIndex
*/
public function testDataIndexFields() {
$mockEngine = $this->createMock( SearchEngine::class );
$title = Title::makeTitle( NS_MAIN, 'Not_Main_Page' );
@ -426,9 +397,6 @@ class ContentHandlerTest extends MediaWikiIntegrationTestCase {
$this->assertEquals( 'wikitext', $data['content_model'] );
}
/**
* @covers \ContentHandler::getParserOutputForIndexing
*/
public function testParserOutputForIndexing() {
$opportunisticUpdateHook =
$this->createMock( OpportunisticLinksUpdateHook::class );
@ -448,9 +416,6 @@ class ContentHandlerTest extends MediaWikiIntegrationTestCase {
$this->assertStringContainsString( 'one who smiths', $out->getRawText() );
}
/**
* @covers \ContentHandler::getContentModels
*/
public function testGetContentModelsHook() {
$this->setTemporaryHook( 'GetContentModels', static function ( &$models ) {
$models[] = 'Ferrari';
@ -459,9 +424,6 @@ class ContentHandlerTest extends MediaWikiIntegrationTestCase {
$this->assertContains( 'Ferrari', ContentHandler::getContentModels() );
}
/**
* @covers \ContentHandler::getSlotDiffRenderer
*/
public function testGetSlotDiffRenderer_default() {
$this->mergeMwGlobalArrayValue( 'wgHooks', [
'GetSlotDiffRenderer' => [],
@ -482,9 +444,6 @@ class ContentHandlerTest extends MediaWikiIntegrationTestCase {
$this->assertInstanceOf( TextSlotDiffRenderer::class, $slotDiffRenderer );
}
/**
* @covers \ContentHandler::getSlotDiffRenderer
*/
public function testGetSlotDiffRenderer_bc() {
$this->mergeMwGlobalArrayValue( 'wgHooks', [
'GetSlotDiffRenderer' => [],
@ -509,9 +468,6 @@ class ContentHandlerTest extends MediaWikiIntegrationTestCase {
);
}
/**
* @covers \ContentHandler::getSlotDiffRenderer
*/
public function testGetSlotDiffRenderer_nobc() {
$this->mergeMwGlobalArrayValue( 'wgHooks', [
'GetSlotDiffRenderer' => [],
@ -536,9 +492,6 @@ class ContentHandlerTest extends MediaWikiIntegrationTestCase {
$this->assertSame( $customSlotDiffRenderer, $slotDiffRenderer );
}
/**
* @covers \ContentHandler::getSlotDiffRenderer
*/
public function testGetSlotDiffRenderer_hook() {
$this->mergeMwGlobalArrayValue( 'wgHooks', [
'GetSlotDiffRenderer' => [],
@ -595,7 +548,6 @@ class ContentHandlerTest extends MediaWikiIntegrationTestCase {
* Superseded by OutputPageTest::testGetJsVarsAboutPageLang
*
* @dataProvider providerGetPageViewLanguage
* @covers \ContentHandler::getPageViewLanguage
*/
public function testGetPageViewLanguage( $namespace, $lang, $variant, $expected ) {
$contentHandler = $this->getMockBuilder( ContentHandler::class )
@ -632,7 +584,6 @@ class ContentHandlerTest extends MediaWikiIntegrationTestCase {
/**
* @dataProvider provideValidateSave
* @covers \ContentHandler::validateSave
*/
public function testValidateSave( $content, $expectedResult ) {
$page = new PageIdentityValue( 0, 1, 'Foo', PageIdentity::LOCAL );

View file

@ -15,6 +15,7 @@ use MediaWiki\Title\Title;
* TODO convert to a pure unit test
*
* @group Database
* @covers \ContentModelChange
*
* @author DannyS712
* @method ContentModelChange newServiceInstance(string $serviceClass, array $parameterOverrides)
@ -44,8 +45,6 @@ class ContentModelChangeTest extends MediaWikiIntegrationTestCase {
/**
* Test that the content model needs to change
*
* @covers \ContentModelChange::doContentModelChange
*/
public function testChangeNeeded() {
$wikipage = $this->getExistingTestPage( 'ExistingPage' );
@ -70,8 +69,6 @@ class ContentModelChangeTest extends MediaWikiIntegrationTestCase {
/**
* Test that the content needs to be valid for the requested model
*
* @covers \ContentModelChange::doContentModelChange
*/
public function testInvalidContent() {
$invalidJSON = 'Foo\nBar\nEaster egg\nT22281';
@ -104,8 +101,6 @@ class ContentModelChangeTest extends MediaWikiIntegrationTestCase {
/**
* Test the EditFilterMergedContent hook can be intercepted
*
* @covers \ContentModelChange::doContentModelChange
*
* @dataProvider provideTestEditFilterMergedContent
* @param string|bool $customMessage Hook message, or false
* @param string $expectedMessage expected fatal
@ -149,8 +144,6 @@ class ContentModelChangeTest extends MediaWikiIntegrationTestCase {
/**
* Test the ContentModelCanBeUsedOn hook can be intercepted
*
* @covers \ContentModelChange::doContentModelChange
*/
public function testContentModelCanBeUsedOn() {
$wikipage = $this->getExistingTestPage( 'ExistingPage' );
@ -188,8 +181,6 @@ class ContentModelChangeTest extends MediaWikiIntegrationTestCase {
/**
* Test that content handler must support direct editing
*
* @covers \ContentModelChange::doContentModelChange
*/
public function testNoDirectEditing() {
$title = Title::newFromText( 'Dummy:NoDirectEditing' );
@ -228,9 +219,6 @@ class ContentModelChangeTest extends MediaWikiIntegrationTestCase {
);
}
/**
* @covers \ContentModelChange::setTags
*/
public function testCannotApplyTags() {
ChangeTags::defineTag( 'edit content model tag' );
@ -246,10 +234,6 @@ class ContentModelChangeTest extends MediaWikiIntegrationTestCase {
);
}
/**
* @covers \ContentModelChange::authorizeChange
* @covers \ContentModelChange::probablyCanChange
*/
public function testCheckPermissions() {
$wikipage = $this->getExistingTestPage( 'ExistingPage' );
$title = $wikipage->getTitle();
@ -313,9 +297,6 @@ class ContentModelChangeTest extends MediaWikiIntegrationTestCase {
}
}
/**
* @covers \ContentModelChange::doContentModelChange
*/
public function testCheckPermissionsThrottle() {
$user = $this->getTestUser()->getUser();

View file

@ -4,6 +4,7 @@
* @group ContentHandler
* @group Database
* ^--- needed, because we do need the database to test link updates
* @covers CssContentHandler
*/
class CssContentHandlerIntegrationTest extends TextContentHandlerIntegrationTest {
public static function provideGetParserOutput() {

View file

@ -5,11 +5,13 @@ use MediaWiki\Content\CssContentHandler;
use MediaWiki\MainConfigNames;
use MediaWiki\Title\Title;
/**
* @covers \MediaWiki\Content\CssContentHandler
*/
class CssContentHandlerTest extends MediaWikiLangTestCase {
/**
* @dataProvider provideMakeRedirectContent
* @covers \MediaWiki\Content\CssContentHandler::makeRedirectContent
*/
public function testMakeRedirectContent( int $namespace, string $title, $expected ) {
$this->overrideConfigValues( [

View file

@ -7,6 +7,7 @@ use MediaWiki\MainConfigNames;
* @group ContentHandler
* @group Database
* ^--- needed, because we do need the database to test link updates
* @covers \MediaWiki\Content\CssContent
*/
class CssContentTest extends TextContentTest {
@ -40,18 +41,12 @@ class CssContentTest extends TextContentTest {
];
}
/**
* @covers \MediaWiki\Content\CssContent::getModel
*/
public function testGetModel() {
$content = $this->newContent( 'hello world.' );
$this->assertEquals( CONTENT_MODEL_CSS, $content->getModel() );
}
/**
* @covers \MediaWiki\Content\CssContent::getContentHandler
*/
public function testGetContentHandler() {
$content = $this->newContent( 'hello world.' );
@ -71,7 +66,6 @@ class CssContentTest extends TextContentTest {
}
/**
* @covers \MediaWiki\Content\CssContent::getRedirectTarget
* @dataProvider provideGetRedirectTarget
*/
public function testGetRedirectTarget( $title, $text ) {
@ -115,7 +109,6 @@ class CssContentTest extends TextContentTest {
/**
* @dataProvider dataEquals
* @covers \MediaWiki\Content\CssContent::equals
*/
public function testEquals( Content $a, Content $b = null, $equal = false ) {
$this->assertEquals( $equal, $a->equals( $b ) );

View file

@ -11,6 +11,8 @@ use MediaWiki\Title\Title;
* See also unit tests at \MediaWiki\Tests\Unit\FallbackContentHandlerTest
*
* @group ContentHandler
* @covers \MediaWiki\Content\FallbackContentHandler
* @covers \ContentHandler
*/
class FallbackContentHandlerTest extends MediaWikiLangTestCase {
@ -25,19 +27,10 @@ class FallbackContentHandlerTest extends MediaWikiLangTestCase {
$this->setService( '_ParserObserver', $this->createMock( ParserObserver::class ) );
}
/**
* @param string $data
* @param string $type
*
* @return FallbackContent
*/
public function newContent( $data, $type = self::CONTENT_MODEL ) {
private function newContent( string $data, string $type = self::CONTENT_MODEL ) {
return new FallbackContent( $data, $type );
}
/**
* @covers \ContentHandler::getSlotDiffRenderer
*/
public function testGetSlotDiffRenderer() {
$context = new RequestContext();
$context->setRequest( new FauxRequest() );
@ -53,9 +46,6 @@ class FallbackContentHandlerTest extends MediaWikiLangTestCase {
$this->assertNotEmpty( $diff );
}
/**
* @covers \MediaWiki\Content\FallbackContentHandler::fillParserOutput
*/
public function testGetParserOutput() {
$this->setUserLang( 'en' );
$this->setContentLang( 'qqx' );

View file

@ -6,6 +6,8 @@ use MediaWiki\Content\JavaScriptContent;
/**
* @group ContentHandler
* @covers \MediaWiki\Content\FallbackContent
* @covers \MediaWiki\Content\FallbackContentHandler
*/
class FallbackContentTest extends MediaWikiLangTestCase {
@ -29,49 +31,31 @@ class FallbackContentTest extends MediaWikiLangTestCase {
return new FallbackContent( $data, $type );
}
/**
* @covers \MediaWiki\Content\FallbackContent::getRedirectTarget
*/
public function testGetRedirectTarget() {
$content = $this->newContent( '#REDIRECT [[Horkyporky]]' );
$this->assertNull( $content->getRedirectTarget() );
}
/**
* @covers \MediaWiki\Content\FallbackContent::isRedirect
*/
public function testIsRedirect() {
$content = $this->newContent( '#REDIRECT [[Horkyporky]]' );
$this->assertFalse( $content->isRedirect() );
}
/**
* @covers \MediaWiki\Content\FallbackContent::isCountable
*/
public function testIsCountable() {
$content = $this->newContent( '[[Horkyporky]]' );
$this->assertFalse( $content->isCountable( true ) );
}
/**
* @covers \MediaWiki\Content\FallbackContent::getTextForSummary
*/
public function testGetTextForSummary() {
$content = $this->newContent( 'Horkyporky' );
$this->assertSame( '', $content->getTextForSummary() );
}
/**
* @covers \MediaWiki\Content\FallbackContent::getTextForSearchIndex
*/
public function testGetTextForSearchIndex() {
$content = $this->newContent( 'Horkyporky' );
$this->assertSame( '', $content->getTextForSearchIndex() );
}
/**
* @covers \MediaWiki\Content\FallbackContent::copy
*/
public function testCopy() {
$content = $this->newContent( 'hello world.' );
$copy = $content->copy();
@ -79,54 +63,36 @@ class FallbackContentTest extends MediaWikiLangTestCase {
$this->assertSame( $content, $copy );
}
/**
* @covers \MediaWiki\Content\FallbackContent::getSize
*/
public function testGetSize() {
$content = $this->newContent( 'hello world.' );
$this->assertEquals( 12, $content->getSize() );
}
/**
* @covers \MediaWiki\Content\FallbackContent::getData
*/
public function testGetData() {
$content = $this->newContent( 'hello world.' );
$this->assertEquals( 'hello world.', $content->getData() );
}
/**
* @covers \MediaWiki\Content\FallbackContent::getNativeData
*/
public function testGetNativeData() {
$content = $this->newContent( 'hello world.' );
$this->assertEquals( 'hello world.', $content->getNativeData() );
}
/**
* @covers \MediaWiki\Content\FallbackContent::getWikitextForTransclusion
*/
public function testGetWikitextForTransclusion() {
$content = $this->newContent( 'hello world.' );
$this->assertFalse( $content->getWikitextForTransclusion() );
}
/**
* @covers \MediaWiki\Content\FallbackContent::getModel
*/
public function testGetModel() {
$content = $this->newContent( "hello world.", 'horkyporky' );
$this->assertEquals( 'horkyporky', $content->getModel() );
}
/**
* @covers \MediaWiki\Content\FallbackContent::getContentHandler
*/
public function testGetContentHandler() {
$this->mergeMwGlobalArrayValue(
'wgContentHandlers',
@ -150,7 +116,6 @@ class FallbackContentTest extends MediaWikiLangTestCase {
/**
* @dataProvider dataIsEmpty
* @covers \MediaWiki\Content\FallbackContent::isEmpty
*/
public function testIsEmpty( $text, $empty ) {
$content = $this->newContent( $text );
@ -170,7 +135,6 @@ class FallbackContentTest extends MediaWikiLangTestCase {
/**
* @dataProvider provideEquals
* @covers \MediaWiki\Content\FallbackContent::equals
*/
public function testEquals( Content $a, Content $b = null, $equal = false ) {
$this->assertEquals( $equal, $a->equals( $b ) );
@ -205,19 +169,12 @@ class FallbackContentTest extends MediaWikiLangTestCase {
];
}
/**
* @covers \MediaWiki\Content\FallbackContent::convert
*/
public function testConvert() {
$content = $this->newContent( 'More horkyporky?' );
$this->assertFalse( $content->convert( CONTENT_MODEL_TEXT ) );
}
/**
* @covers \MediaWiki\Content\FallbackContent::__construct
* @covers \MediaWiki\Content\FallbackContentHandler::serializeContent
*/
public function testSerialize() {
$content = $this->newContent( 'Hörkypörky', 'horkyporky' );

View file

@ -4,6 +4,7 @@
* @group ContentHandler
* @group Database
* ^--- needed, because we do need the database to test link updates
* @covers \JavaScriptContentHandler
*/
class JavaScriptContentHandlerIntegrationTest extends TextContentHandlerIntegrationTest {
public static function provideGetParserOutput() {

View file

@ -6,10 +6,11 @@ use MediaWiki\MainConfigNames;
use MediaWiki\Title\Title;
/**
* @covers \JavaScriptContent
* Needs database to do link updates.
*
* @group ContentHandler
* @group Database
* ^--- needed, because we do need the database to test link updates
* @covers \JavaScriptContent
*/
class JavaScriptContentTest extends TextContentTest {
@ -17,60 +18,6 @@ class JavaScriptContentTest extends TextContentTest {
return new JavaScriptContent( $text );
}
// XXX: Unused function
public static function dataGetSection() {
return [
[ WikitextContentTest::$sections,
'0',
null
],
[ WikitextContentTest::$sections,
'2',
null
],
[ WikitextContentTest::$sections,
'8',
null
],
];
}
// XXX: Unused function
public static function dataReplaceSection() {
return [
[ WikitextContentTest::$sections,
'0',
'No more',
null,
null
],
[ WikitextContentTest::$sections,
'',
'No more',
null,
null
],
[ WikitextContentTest::$sections,
'2',
"== TEST ==\nmore fun",
null,
null
],
[ WikitextContentTest::$sections,
'8',
'No more',
null,
null
],
[ WikitextContentTest::$sections,
'new',
'No more',
'New',
null
],
];
}
public function testAddSectionHeader() {
$content = $this->newContent( 'hello world' );
$c = $content->addSectionHeader( 'test' );
@ -222,6 +169,7 @@ class JavaScriptContentTest extends TextContentTest {
$this->assertEquals( CONTENT_MODEL_JAVASCRIPT, $content->getContentHandler()->getModelID() );
}
// NOTE: Overridden by subclass!
public static function dataEquals() {
return [
[ new JavaScriptContent( "hallo" ), null, false ],

View file

@ -9,6 +9,9 @@ use MediaWiki\Page\PageIdentityValue;
use MediaWiki\Parser\ParserOutput;
use MediaWiki\Title\Title;
/**
* @covers \MediaWiki\Content\JsonContentHandler
*/
class JsonContentHandlerIntegrationTest extends MediaWikiLangTestCase {
public static function provideDataAndParserText() {
@ -62,7 +65,6 @@ class JsonContentHandlerIntegrationTest extends MediaWikiLangTestCase {
/**
* @dataProvider provideDataAndParserText
* @covers \MediaWiki\Content\JsonContentHandler::fillParserOutput
*/
public function testFillParserOutput( $data, $expected ) {
if ( !is_string( $data ) ) {
@ -86,9 +88,6 @@ class JsonContentHandlerIntegrationTest extends MediaWikiLangTestCase {
$this->assertEquals( $expected, $parserOutput->getText() );
}
/**
* @covers \MediaWiki\Content\JsonContentHandler::validateSave
*/
public function testValidateSave() {
$handler = new JsonContentHandler();
$validationParams = new ValidationParams(

View file

@ -8,6 +8,7 @@ use MediaWiki\MainConfigNames;
/**
* @group ContentHandlerFactory
* @covers \MediaWiki\MediaWikiServices::getContentHandlerFactory
*/
class RegistrationContentHandlerFactoryToMediaWikiServicesTest extends MediaWikiIntegrationTestCase {
@ -41,9 +42,6 @@ class RegistrationContentHandlerFactoryToMediaWikiServicesTest extends MediaWiki
);
}
/**
* @covers \MediaWiki\MediaWikiServices::getContentHandlerFactory
*/
public function testCallFromService_get_ok(): void {
$this->assertInstanceOf(
\MediaWiki\Content\IContentHandlerFactory::class,
@ -64,9 +62,6 @@ class RegistrationContentHandlerFactoryToMediaWikiServicesTest extends MediaWiki
);
}
/**
* @covers \MediaWiki\MediaWikiServices::getContentHandlerFactory
*/
public function testCallFromService_second_same(): void {
$this->assertSame(
$this->getServiceContainer()->getContentHandlerFactory(),
@ -74,9 +69,6 @@ class RegistrationContentHandlerFactoryToMediaWikiServicesTest extends MediaWiki
);
}
/**
* @covers \MediaWiki\MediaWikiServices::getContentHandlerFactory
*/
public function testCallFromService_afterCustomDefine_same(): void {
$factory = $this->getServiceContainer()->getContentHandlerFactory();
$factory->defineContentHandler(

View file

@ -7,6 +7,7 @@ use Wikimedia\Parsoid\ParserTests\TestUtils;
* @group ContentHandler
* @group Database
* ^--- needed, because we do need the database to test link updates
* @covers \MediaWiki\Content\TextContentHandler
*/
class TextContentHandlerIntegrationTest extends MediaWikiLangTestCase {
@ -29,7 +30,6 @@ class TextContentHandlerIntegrationTest extends MediaWikiLangTestCase {
/**
* @dataProvider provideGetParserOutput
* @covers \MediaWiki\Content\TextContentHandler::fillParserOutput
*/
public function testGetParserOutput( $title, $model, $text, $expectedHtml,
$expectedFields = null, $parserOptions = null

View file

@ -8,9 +8,12 @@ use MediaWiki\Title\Title;
use MediaWiki\User\User;
/**
* Needs database to do link updates.
*
* @group ContentHandler
* @group Database
* ^--- needed, because we do need the database to test link updates
* @covers \MediaWiki\Content\TextContent
* @covers \MediaWiki\Content\TextContentHandler
*/
class TextContentTest extends MediaWikiLangTestCase {
protected $context;
@ -40,6 +43,8 @@ class TextContentTest extends MediaWikiLangTestCase {
}
/**
* NOTE: Overridden by subclass!
*
* @param string $text
* @return TextContent
*/
@ -57,7 +62,6 @@ class TextContentTest extends MediaWikiLangTestCase {
/**
* @dataProvider dataGetRedirectTarget
* @covers \MediaWiki\Content\TextContent::getRedirectTarget
*/
public function testGetRedirectTarget( $text, $expected ) {
$content = $this->newContent( $text );
@ -72,7 +76,6 @@ class TextContentTest extends MediaWikiLangTestCase {
/**
* @dataProvider dataGetRedirectTarget
* @covers \MediaWiki\Content\TextContent::isRedirect
*/
public function testIsRedirect( $text, $expected ) {
$content = $this->newContent( $text );
@ -97,7 +100,6 @@ class TextContentTest extends MediaWikiLangTestCase {
/**
* @dataProvider dataIsCountable
* @covers \MediaWiki\Content\TextContent::isCountable
*/
public function testIsCountable( $text, $hasLinks, $mode, $expected ) {
$this->overrideConfigValue( MainConfigNames::ArticleCountMethod, $mode );
@ -134,7 +136,6 @@ class TextContentTest extends MediaWikiLangTestCase {
/**
* @dataProvider dataGetTextForSummary
* @covers \MediaWiki\Content\TextContent::getTextForSummary
*/
public function testGetTextForSummary( $text, $maxlength, $expected ) {
$content = $this->newContent( $text );
@ -143,7 +144,6 @@ class TextContentTest extends MediaWikiLangTestCase {
}
/**
* @covers \MediaWiki\Content\TextContent::copy
*/
public function testCopy() {
$content = $this->newContent( 'hello world.' );
@ -153,13 +153,6 @@ class TextContentTest extends MediaWikiLangTestCase {
$this->assertEquals( 'hello world.', $copy->getText() );
}
/**
* @covers \MediaWiki\Content\TextContent::getSize
* @covers \MediaWiki\Content\TextContent::getText
* @covers \MediaWiki\Content\TextContent::getTextForSearchIndex
* @covers \MediaWiki\Content\TextContent::getNativeData
* @covers \MediaWiki\Content\TextContent::getWikitextForTransclusion
*/
public function testGetTextMethods() {
$content = $this->newContent( 'hello world.' );
@ -170,18 +163,12 @@ class TextContentTest extends MediaWikiLangTestCase {
$this->assertEquals( 'hello world.', $content->getWikitextForTransclusion() );
}
/**
* @covers \MediaWiki\Content\TextContent::getModel
*/
public function testGetModel() {
$content = $this->newContent( "hello world." );
$this->assertEquals( CONTENT_MODEL_TEXT, $content->getModel() );
}
/**
* @covers \MediaWiki\Content\TextContent::getContentHandler
*/
public function testGetContentHandler() {
$content = $this->newContent( "hello world." );
@ -199,7 +186,6 @@ class TextContentTest extends MediaWikiLangTestCase {
/**
* @dataProvider dataIsEmpty
* @covers \MediaWiki\Content\TextContent::isEmpty
*/
public function testIsEmpty( $text, $empty ) {
$content = $this->newContent( $text );
@ -219,7 +205,6 @@ class TextContentTest extends MediaWikiLangTestCase {
/**
* @dataProvider dataEquals
* @covers \MediaWiki\Content\TextContent::equals
*/
public function testEquals( Content $a, Content $b = null, $equal = false ) {
$this->assertEquals( $equal, $a->equals( $b ) );
@ -256,7 +241,6 @@ class TextContentTest extends MediaWikiLangTestCase {
/**
* @dataProvider provideConvert
* @covers \MediaWiki\Content\TextContent::convert
*/
public function testConvert( $text, $model, $lossy, $expectedNative ) {
$content = $this->newContent( $text );
@ -273,7 +257,6 @@ class TextContentTest extends MediaWikiLangTestCase {
}
/**
* @covers \MediaWiki\Content\TextContent::normalizeLineEndings
* @dataProvider provideNormalizeLineEndings
*/
public function testNormalizeLineEndings( $input, $expected ) {
@ -297,10 +280,6 @@ class TextContentTest extends MediaWikiLangTestCase {
];
}
/**
* @covers \MediaWiki\Content\TextContent::__construct
* @covers \MediaWiki\Content\TextContentHandler::serializeContent
*/
public function testSerialize() {
$cnt = $this->newContent( 'testing text' );

View file

@ -4,6 +4,9 @@ use MediaWiki\MainConfigNames;
use MediaWiki\Title\Title;
use MediaWiki\User\User;
/**
* @covers \MediaWiki\Content\Transform\ContentTransformer
*/
class ContentTransformerTest extends MediaWikiIntegrationTestCase {
public static function preSaveTransformProvider() {
@ -16,7 +19,6 @@ class ContentTransformerTest extends MediaWikiIntegrationTestCase {
}
/**
* @covers \MediaWiki\Content\Transform\ContentTransformer::preSaveTransform
*
* @dataProvider preSaveTransformProvider
*/
@ -42,8 +44,6 @@ class ContentTransformerTest extends MediaWikiIntegrationTestCase {
}
/**
* @covers \MediaWiki\Content\Transform\ContentTransformer::preloadTransform
*
* @dataProvider preloadTransformProvider
*/
public function testPreloadTransform( $content, $expectedContainText ) {

View file

@ -12,6 +12,7 @@ use Wikimedia\Parsoid\Parsoid;
* @group ContentHandler
* @group Database
* ^--- needed, because we do need the database to test link updates
* @covers \WikitextContentHandler
*/
class WikitextContentHandlerIntegrationTest extends TextContentHandlerIntegrationTest {
protected function setUp(): void {
@ -229,7 +230,6 @@ class WikitextContentHandlerIntegrationTest extends TextContentHandlerIntegratio
/**
* @dataProvider provideGetParserOutput
* @covers \WikitextContentHandler::fillParserOutput
*/
public function testGetParserOutput( $title, $model, $text, $expectedHtml,
$expectedFields = null, $options = null
@ -257,8 +257,6 @@ class WikitextContentHandlerIntegrationTest extends TextContentHandlerIntegratio
* @param LinkTarget $target
* @param string $expectedWT Serialized wikitext form of the content object built
* @param string $expectedTarget Expected target string in the HTML redirect
* @covers \WikitextContentHandler::makeRedirectContent
* @covers \WikitextContentHandler::getParserOutput
*/
public function testMakeRedirectContent( LinkTarget $target, string $expectedWT, string $expectedTarget ) {
$this->getServiceContainer()->resetServiceForTesting( 'ContentLanguage' );

View file

@ -13,10 +13,12 @@ use Wikimedia\TestingAccessWrapper;
* See also unit tests at \MediaWiki\Tests\Unit\WikitextContentHandlerTest
*
* @group ContentHandler
* @covers \WikitextContentHandler
* @covers \TextContentHandler
* @covers \ContentHandler
*/
class WikitextContentHandlerTest extends MediaWikiLangTestCase {
/** @var WikitextContentHandler */
private $handler;
private WikitextContentHandler $handler;
protected function setUp(): void {
parent::setUp();
@ -59,7 +61,6 @@ class WikitextContentHandlerTest extends MediaWikiLangTestCase {
/**
* @dataProvider dataMerge3
* @covers \WikitextContentHandler::merge3
*/
public function testMerge3( $old, $mine, $yours, $expected ) {
$this->markTestSkippedIfNoDiff3();
@ -125,7 +126,6 @@ class WikitextContentHandlerTest extends MediaWikiLangTestCase {
/**
* @dataProvider dataGetAutosummary
* @covers \WikitextContentHandler::getAutosummary
*/
public function testGetAutosummary( $old, $new, $flags, $expected ) {
$oldContent = $old === null ? null : new WikitextContent( $old );
@ -217,7 +217,6 @@ class WikitextContentHandlerTest extends MediaWikiLangTestCase {
/**
* @dataProvider dataGetChangeTag
* @covers \WikitextContentHandler::getChangeTag
*/
public function testGetChangeTag( $old, $new, $flags, $expected ) {
$this->overrideConfigValue( MainConfigNames::SoftwareTags, [
@ -237,10 +236,6 @@ class WikitextContentHandlerTest extends MediaWikiLangTestCase {
$this->assertSame( $expected, $tag );
}
/**
* @covers \WikitextContentHandler::getDataForSearchIndex
* @covers \ContentHandler::getFieldsForSearchIndex
*/
public function testGetFieldsForSearchIndex() {
$searchEngine = $this->createMock( SearchEngine::class );
@ -260,9 +255,6 @@ class WikitextContentHandlerTest extends MediaWikiLangTestCase {
$this->assertArrayHasKey( 'content_model', $fields );
}
/**
* @covers WikitextContentHandler::getDataForSearchIndex
*/
public function testDataIndexFieldsFile() {
$mockEngine = $this->createMock( SearchEngine::class );
$title = Title::makeTitle( NS_FILE, 'Somefile.jpg' );
@ -293,9 +285,6 @@ class WikitextContentHandlerTest extends MediaWikiLangTestCase {
$this->assertEquals( 'This is file content', $data['file_text'] );
}
/**
* @covers \WikitextContentHandler::fillParserOutput
*/
public function testHadSignature() {
$services = $this->getServiceContainer();

View file

@ -11,6 +11,7 @@ use MediaWiki\Title\Title;
*
* @group Database
* ^--- needed, because we do need the database to test link updates
* @covers \WikitextContent
*/
class WikitextContentTest extends TextContentTest {
public static $sections = "Intro
@ -49,7 +50,6 @@ just a test"
/**
* @dataProvider dataGetSection
* @covers \WikitextContent::getSection
*/
public function testGetSection( $text, $sectionId, $expectedText ) {
$content = $this->newContent( $text );
@ -104,7 +104,6 @@ just a test"
/**
* @dataProvider dataReplaceSection
* @covers \WikitextContent::replaceSection
*/
public function testReplaceSection( $text, $section, $with, $sectionTitle, $expected ) {
$content = $this->newContent( $text );
@ -114,9 +113,6 @@ just a test"
$this->assertEquals( $expected, $c ? $c->getText() : null );
}
/**
* @covers \WikitextContent::addSectionHeader
*/
public function testAddSectionHeader() {
$content = $this->newContent( 'hello world' );
$content = $content->addSectionHeader( 'test' );
@ -218,9 +214,6 @@ just a test"
];
}
/**
* @covers \WikitextContent::matchMagicWord
*/
public function testMatchMagicWord() {
$mw = $this->getServiceContainer()->getMagicWordFactory()->get( "staticredirect" );
@ -234,9 +227,6 @@ just a test"
);
}
/**
* @covers \WikitextContent::updateRedirect
*/
public function testUpdateRedirect() {
$target = Title::makeTitle( NS_MAIN, 'TestUpdateRedirect_target' );
@ -259,18 +249,12 @@ just a test"
);
}
/**
* @covers \WikitextContent::getModel
*/
public function testGetModel() {
$content = $this->newContent( "hello world." );
$this->assertEquals( CONTENT_MODEL_WIKITEXT, $content->getModel() );
}
/**
* @covers \WikitextContent::getContentHandler
*/
public function testGetContentHandler() {
$content = $this->newContent( "hello world." );
@ -278,8 +262,7 @@ just a test"
}
/**
* @covers \ParserOptions::getRedirectTarget
* @covers \ParserOptions::setRedirectTarget
* @covers \ParserOptions
*/
public function testRedirectParserOption() {
$title = Title::makeTitle( NS_MAIN, 'TestRedirectParserOption' );

View file

@ -7,11 +7,11 @@ use Wikimedia\ObjectFactory\ObjectFactory;
/**
* @group ContentHandlerFactory
* @covers \MediaWiki\Content\ContentHandlerFactory
*/
class ContentHandlerFactoryTest extends MediaWikiUnitTestCase {
/** @var TestLogger */
private $logger;
private TestLogger $logger;
protected function setUp(): void {
parent::setUp();
@ -36,12 +36,6 @@ class ContentHandlerFactoryTest extends MediaWikiUnitTestCase {
}
/**
* @covers \MediaWiki\Content\ContentHandlerFactory::getContentHandler
* @covers \MediaWiki\Content\ContentHandlerFactory::createForModelID
* @covers \MediaWiki\Content\ContentHandlerFactory::createContentHandlerFromHandlerSpec
* @covers \MediaWiki\Content\ContentHandlerFactory::validateContentHandler
* @covers \MediaWiki\Content\ContentHandlerFactory::__construct
*
* @dataProvider provideHandlerSpecs $handlerSpecs
*/
public function testGetContentHandler_callWithProvider_same(
@ -81,11 +75,6 @@ class ContentHandlerFactoryTest extends MediaWikiUnitTestCase {
}
/**
* @covers \MediaWiki\Content\ContentHandlerFactory::getContentHandler
* @covers \MediaWiki\Content\ContentHandlerFactory::createForModelID
* @covers \MediaWiki\Content\ContentHandlerFactory::createContentHandlerFromHook
* @covers \MediaWiki\Content\ContentHandlerFactory::validateContentHandler
*
* @dataProvider provideHandlerSpecs $handlerSpecs
*/
public function testGetContentHandler_hookWithProvider_same(
@ -187,11 +176,6 @@ class ContentHandlerFactoryTest extends MediaWikiUnitTestCase {
}
/**
* @covers \MediaWiki\Content\ContentHandlerFactory::getContentHandler
* @covers \MediaWiki\Content\ContentHandlerFactory::createForModelID
* @covers \MediaWiki\Content\ContentHandlerFactory::createContentHandlerFromHandlerSpec
* @covers \MediaWiki\Content\ContentHandlerFactory::validateContentHandler
*
* @dataProvider provideHandlerSpecsWithException
*/
public function testCreateContentHandlerForModelID_callWithProvider_throwsException(
@ -214,11 +198,6 @@ class ContentHandlerFactoryTest extends MediaWikiUnitTestCase {
$factory->getContentHandler( $modelID );
}
/**
* @covers \MediaWiki\Content\ContentHandlerFactory::createForModelID
* @covers \MediaWiki\Content\ContentHandlerFactory::createContentHandlerFromHandlerSpec
* @covers \MediaWiki\Content\ContentHandlerFactory::validateContentHandler
*/
public function testCreateContentHandlerForModelID_callNotExist_throwMWUCMException() {
$this->expectException( MWUnknownContentModelException::class );
$factory = new ContentHandlerFactory(
@ -230,14 +209,6 @@ class ContentHandlerFactoryTest extends MediaWikiUnitTestCase {
$factory->getContentHandler( 'ModelNameNotExist' );
}
/**
* @covers \MediaWiki\Content\ContentHandlerFactory::defineContentHandler
* @covers \MediaWiki\Content\ContentHandlerFactory::getContentHandler
* @covers \MediaWiki\Content\ContentHandlerFactory::createForModelID
* @covers \MediaWiki\Content\ContentHandlerFactory::createContentHandlerFromHandlerSpec
* @covers \MediaWiki\Content\ContentHandlerFactory::validateContentHandler
* @covers \MediaWiki\Content\ContentHandlerFactory::isDefinedModel
*/
public function testDefineContentHandler_flow_throwsException() {
$objectFactory = $this->createMock( ObjectFactory::class );
$objectFactory
@ -260,8 +231,6 @@ class ContentHandlerFactoryTest extends MediaWikiUnitTestCase {
}
/**
* @covers \MediaWiki\Content\ContentHandlerFactory::getContentModels
*
* @dataProvider provideValidDummySpecList
*/
public function testGetContentModels_flow_same(
@ -303,8 +272,6 @@ class ContentHandlerFactoryTest extends MediaWikiUnitTestCase {
}
/**
* @covers \MediaWiki\Content\ContentHandlerFactory::isDefinedModel
* @covers \MediaWiki\Content\ContentHandlerFactory::createContentHandlerFromHook
* @dataProvider provideValidDummySpecList
*/
public function testIsDefinedModel_flow_same(
@ -363,9 +330,6 @@ class ContentHandlerFactoryTest extends MediaWikiUnitTestCase {
];
}
/**
* @covers \MediaWiki\Content\ContentHandlerFactory::getContentModels
*/
public function testGetContentModels_empty_empty() {
$factory = new ContentHandlerFactory(
[],
@ -377,10 +341,6 @@ class ContentHandlerFactoryTest extends MediaWikiUnitTestCase {
$this->assertArrayEquals( [], $factory->getContentModels() );
}
/**
* @covers \MediaWiki\Content\ContentHandlerFactory::getAllContentFormats
* @covers \MediaWiki\Content\ContentHandlerFactory::defineContentHandler
*/
public function testGetAllContentFormats_flow_same() {
$contentHandler1 = $this->createMock( DummyContentHandlerForTesting::class );
$contentHandler1->method( 'getSupportedFormats' )->willReturn( [ 'format 1' ] );

View file

@ -13,20 +13,14 @@ use MediaWikiUnitTestCase;
* Split from \FallbackContentHandlerTest integration tests
*
* @group ContentHandler
* @coversDefaultClass \MediaWiki\Content\FallbackContentHandler
* @covers \MediaWiki\Content\FallbackContentHandler
*/
class FallbackContentHandlerTest extends MediaWikiUnitTestCase {
/**
* @covers ::supportsDirectEditing
*/
public function testSupportsDirectEditing() {
$handler = new FallbackContentHandler( 'horkyporky' );
$this->assertFalse( $handler->supportsDirectEditing(), 'direct editing supported' );
}
/**
* @covers ::serializeContent
*/
public function testSerializeContent() {
$handler = new FallbackContentHandler( 'horkyporky' );
$content = new FallbackContent( 'hello world', 'horkyporky' );
@ -38,9 +32,6 @@ class FallbackContentHandlerTest extends MediaWikiUnitTestCase {
);
}
/**
* @covers ::unserializeContent
*/
public function testUnserializeContent() {
$handler = new FallbackContentHandler( 'horkyporky' );
$content = $handler->unserializeContent( 'hello world' );
@ -50,9 +41,6 @@ class FallbackContentHandlerTest extends MediaWikiUnitTestCase {
$this->assertEquals( 'hello world', $content->getData() );
}
/**
* @covers ::makeEmptyContent
*/
public function testMakeEmptyContent() {
$handler = new FallbackContentHandler( 'horkyporky' );
$content = $handler->makeEmptyContent();
@ -73,16 +61,12 @@ class FallbackContentHandlerTest extends MediaWikiUnitTestCase {
/**
* @dataProvider dataIsSupportedFormat
* @covers ::isSupportedFormat
*/
public function testIsSupportedFormat( $format, $supported ) {
$handler = new FallbackContentHandler( 'horkyporky' );
$this->assertEquals( $supported, $handler->isSupportedFormat( $format ) );
}
/**
* @covers ::getSecondaryDataUpdates
*/
public function testGetSecondaryDataUpdates() {
$title = $this->createMock( Title::class );
$content = new FallbackContent( '', 'horkyporky' );
@ -93,9 +77,6 @@ class FallbackContentHandlerTest extends MediaWikiUnitTestCase {
$this->assertEquals( [], $updates );
}
/**
* @covers ::getDeletionUpdates
*/
public function testGetDeletionUpdates() {
$title = $this->createMock( Title::class );
$handler = new FallbackContentHandler( 'horkyporky' );

View file

@ -3,11 +3,11 @@
use MediaWiki\Content\JsonContent;
use MediaWiki\Content\JsonContentHandler;
/**
* @covers \MediaWiki\Content\JsonContentHandler
*/
class JsonContentHandlerTest extends \MediaWikiUnitTestCase {
/**
* @covers \MediaWiki\Content\JsonContentHandler::makeEmptyContent
*/
public function testMakeEmptyContent() {
$handler = new JsonContentHandler();
$content = $handler->makeEmptyContent();

View file

@ -4,19 +4,18 @@ use MediaWiki\Content\TextContentHandler;
/**
* @group ContentHandler
* @covers \MediaWiki\Content\TextContentHandler
* @covers \ContentHandler
*/
class TextContentHandlerTest extends MediaWikiUnitTestCase {
/**
* @covers \MediaWiki\Content\TextContentHandler::supportsDirectEditing
*/
public function testSupportsDirectEditing() {
$handler = new TextContentHandler();
$this->assertTrue( $handler->supportsDirectEditing(), 'direct editing is supported' );
}
/**
* @covers \SearchEngine::makeSearchFieldMapping
* @covers \ContentHandler::getFieldsForSearchIndex
* @covers \SearchEngine
*/
public function testFieldsForIndex() {
$handler = new TextContentHandler();
@ -38,16 +37,12 @@ class TextContentHandlerTest extends MediaWikiUnitTestCase {
return $mockField;
} );
/**
* @var SearchEngine $mockEngine
*/
/** @var SearchEngine $mockEngine */
$fields = $handler->getFieldsForSearchIndex( $mockEngine );
$mappedFields = [];
foreach ( $fields as $name => $field ) {
$this->assertInstanceOf( SearchIndexField::class, $field );
/**
* @var SearchIndexField $field
*/
/** @var SearchIndexField $field */
$mappedFields[$name] = $field->getMapping( $mockEngine );
}
$this->assertArrayHasKey( 'language', $mappedFields );

View file

@ -30,7 +30,7 @@ use WikitextContentHandler;
* Split from \WikitextContentHandlerTest integration tests
*
* @group ContentHandler
* @coversDefaultClass \WikitextContentHandler
* @covers \WikitextContentHandler
*/
class WikitextContentHandlerTest extends MediaWikiUnitTestCase {
use MockTitleTrait;
@ -48,9 +48,6 @@ class WikitextContentHandlerTest extends MediaWikiUnitTestCase {
);
}
/**
* @covers ::serializeContent
*/
public function testSerializeContent() {
$content = new WikitextContent( 'hello world' );
$handler = $this->newWikitextContentHandler();
@ -65,9 +62,6 @@ class WikitextContentHandlerTest extends MediaWikiUnitTestCase {
$handler->serializeContent( $content, 'dummy/foo' );
}
/**
* @covers ::unserializeContent
*/
public function testUnserializeContent() {
$handler = $this->newWikitextContentHandler();
@ -81,9 +75,6 @@ class WikitextContentHandlerTest extends MediaWikiUnitTestCase {
$handler->unserializeContent( 'hello world', 'dummy/foo' );
}
/**
* @covers \WikitextContentHandler::makeEmptyContent
*/
public function testMakeEmptyContent() {
$handler = $this->newWikitextContentHandler();
$content = $handler->makeEmptyContent();
@ -102,24 +93,17 @@ class WikitextContentHandlerTest extends MediaWikiUnitTestCase {
/**
* @dataProvider dataIsSupportedFormat
* @covers ::isSupportedFormat
*/
public function testIsSupportedFormat( $format, $supported ) {
$handler = $this->newWikitextContentHandler();
$this->assertEquals( $supported, $handler->isSupportedFormat( $format ) );
}
/**
* @covers ::supportsDirectEditing
*/
public function testSupportsDirectEditing() {
$handler = $this->newWikiTextContentHandler();
$this->assertTrue( $handler->supportsDirectEditing(), 'direct editing is supported' );
}
/**
* @covers ::getSecondaryDataUpdates
*/
public function testGetSecondaryDataUpdates() {
$title = $this->createMock( Title::class );
$content = new WikitextContent( '' );
@ -131,9 +115,6 @@ class WikitextContentHandlerTest extends MediaWikiUnitTestCase {
$this->assertEquals( [], $updates );
}
/**
* @covers ::getDeletionUpdates
*/
public function testGetDeletionUpdates() {
$title = $this->createMock( Title::class );
$handler = $this->newWikitextContentHandler();
@ -143,7 +124,6 @@ class WikitextContentHandlerTest extends MediaWikiUnitTestCase {
}
/**
* @covers ::fillParserOutput
* @dataProvider provideFillParserOutput
*/
public function testFillParserOutput( $useParsoid = true, $testRedirect = false ) {