| 1 |
<?php |
| 2 |
|
| 3 |
namespace MediaWiki\Tests\Export; |
| 4 |
|
| 5 |
use FactoryArgTestTrait; |
| 6 |
use MediaWiki\Export\WikiExporterFactory; |
| 7 |
use MediaWiki\MainConfigNames; |
| 8 |
use MediaWikiIntegrationTestCase; |
| 9 |
use WikiExporter; |
| 10 |
use XmlDumpWriter; |
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
class WikiExporterFactoryTest extends MediaWikiIntegrationTestCase { |
| 16 |
use FactoryArgTestTrait; |
| 17 |
|
| 18 |
protected function setUp(): void { |
| 19 |
parent::setUp(); |
| 20 |
$this->overrideConfigValue( |
| 21 |
MainConfigNames::XmlDumpSchemaVersion, |
| 22 |
XmlDumpWriter::$supportedSchemas[0] |
| 23 |
); |
| 24 |
} |
| 25 |
|
| 26 |
protected static function getFactoryClass() { |
| 27 |
return WikiExporterFactory::class; |
| 28 |
} |
| 29 |
|
| 30 |
protected static function getInstanceClass() { |
| 31 |
return WikiExporter::class; |
| 32 |
} |
| 33 |
|
| 34 |
protected static function getExtraClassArgCount() { |
| 35 |
return 4; |
| 36 |
} |
| 37 |
|
| 38 |
protected function getFactoryMethodName() { |
| 39 |
return 'getWikiExporter'; |
| 40 |
} |
| 41 |
|
| 42 |
protected function getOverriddenMockValueForParam( $param ) { |
| 43 |
if ( $param->getName() === 'text' ) { |
| 44 |
return [ WikiExporter::TEXT ]; |
| 45 |
} |
| 46 |
return []; |
| 47 |
} |
| 48 |
} |