2021-07-21 23:49:49 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace MediaWiki\Tests\Export;
|
|
|
|
|
|
|
|
|
|
use FactoryArgTestTrait;
|
|
|
|
|
use MediaWiki\Export\WikiExporterFactory;
|
|
|
|
|
use MediaWikiIntegrationTestCase;
|
|
|
|
|
use WikiExporter;
|
|
|
|
|
use XmlDumpWriter;
|
|
|
|
|
|
|
|
|
|
/**
|
2022-01-21 03:35:20 +00:00
|
|
|
* @covers \MediaWiki\Export\WikiExporterFactory
|
2021-07-21 23:49:49 +00:00
|
|
|
*/
|
|
|
|
|
class WikiExporterFactoryTest extends MediaWikiIntegrationTestCase {
|
|
|
|
|
use FactoryArgTestTrait;
|
|
|
|
|
|
|
|
|
|
protected function setUp(): void {
|
|
|
|
|
parent::setUp();
|
|
|
|
|
$this->setMwGlobals( [
|
|
|
|
|
'XmlDumpSchemaVersion' => XmlDumpWriter::$supportedSchemas[0],
|
|
|
|
|
] );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected static function getFactoryClass() {
|
|
|
|
|
return WikiExporterFactory::class;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected static function getInstanceClass() {
|
|
|
|
|
return WikiExporter::class;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected static function getExtraClassArgCount() {
|
|
|
|
|
return 4;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected function getFactoryMethodName() {
|
|
|
|
|
return 'getWikiExporter';
|
|
|
|
|
}
|
2022-01-21 03:35:20 +00:00
|
|
|
|
|
|
|
|
protected function getOverriddenMockValueForParam( $param ) {
|
|
|
|
|
if ( $param->getName() === 'text' ) {
|
|
|
|
|
return [ WikiExporter::TEXT ];
|
|
|
|
|
}
|
|
|
|
|
return [];
|
|
|
|
|
}
|
2021-07-21 23:49:49 +00:00
|
|
|
}
|