*/
class ImportTest extends MediaWikiLangTestCase {
- private function getDataSource( $xml ) {
- return new ImportStringSource( $xml );
- }
-
/**
* @covers WikiImporter
* @dataProvider getUnknownTagsXML
* @param string $title
*/
public function testUnknownXMLTags( $xml, $text, $title ) {
- $source = $this->getDataSource( $xml );
+ $source = new ImportStringSource( $xml );
$importer = new WikiImporter(
$source,
* @param string|null $redirectTitle
*/
public function testHandlePageContainsRedirect( $xml, $redirectTitle ) {
- $source = $this->getDataSource( $xml );
+ $source = new ImportStringSource( $xml );
$redirect = null;
$callback = function ( Title $title, ForeignTitle $foreignTitle, $revCount,
* @param array|null $namespaces
*/
public function testSiteInfoContainsNamespaces( $xml, $namespaces ) {
- $source = $this->getDataSource( $xml );
+ $source = new ImportStringSource( $xml );
$importNamespaces = null;
$callback = function ( array $siteinfo, $innerImporter ) use ( &$importNamespaces ) {
$n = ( $assign ? 1 : 0 ) + ( $create ? 2 : 0 );
// phpcs:disable Generic.Files.LineLength
- $source = $this->getDataSource( <<<EOF
+ $source = new ImportStringSource( <<<EOF
<mediawiki xmlns="http://www.mediawiki.org/xml/export-0.10/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.mediawiki.org/xml/export-0.10/ http://www.mediawiki.org/xml/export-0.10.xsd" version="0.10" xml:lang="en">
<page>
<title>TestImportPage</title>