32 use MediaWikiCoversValidator;
33 use PHPUnit4And6Compat;
38 $store->expects( $this->
once() )
39 ->method(
'saveSites' )
40 ->will( $this->
returnCallback(
function ( $sites ) use ( $expectedSites ) {
44 $store->expects( $this->
any() )
45 ->method(
'getSites' )
48 $errorHandler = $this->
getMockBuilder( Psr\Log\LoggerInterface::class )->getMock();
49 $errorHandler->expects( $this->
exactly( $errorCount ) )
53 $importer->setExceptionCallback( [ $errorHandler,
'error' ] );
68 $foo->setGlobalId(
'Foo' );
71 $acme->setGlobalId(
'acme.com' );
72 $acme->setGroup(
'Test' );
77 $dewiki->setGlobalId(
'dewiki' );
78 $dewiki->setGroup(
'wikipedia' );
79 $dewiki->setForward(
true );
83 $dewiki->setPath( MediaWikiSite::PATH_PAGE,
'http://de.wikipedia.org/wiki/' );
84 $dewiki->setSource(
'meta.wikimedia.org' );
92 '<sites><Foo><globalid>Foo</globalid></Foo><Bar><quux>Bla</quux></Bar></sites>',
97 '<site><globalid>Foo</globalid></site>' .
103 '<site><globalid>Foo</globalid></site>' .
105 '<globalid>acme.com</globalid>' .
106 '<localid type="interwiki">acme</localid>' .
107 '<group>Test</group>' .
108 '<path type="link">http://acme.com/</path>' .
110 '<site type="mediawiki">' .
111 '<source>meta.wikimedia.org</source>' .
112 '<globalid>dewiki</globalid>' .
113 '<localid type="interwiki">wikipedia</localid>' .
114 '<localid type="equivalent">de</localid>' .
115 '<group>wikipedia</group>' .
117 '<path type="link">http://de.wikipedia.org/w/</path>' .
118 '<path type="page_path">http://de.wikipedia.org/wiki/</path>' .
125 '<site><globalid>Foo</globalid></site>' .
126 '<site><barf>Foo</barf></site>' .
128 '<globalid>acme.com</globalid>' .
129 '<localid type="interwiki">acme</localid>' .
130 '<silly>boop!</silly>' .
131 '<group>Test</group>' .
132 '<path type="link">http://acme.com/</path>' .
146 $importer->importFromXML( $xml );
154 $importer->importFromXML(
'THIS IS NOT XML' );
159 $foo->setGlobalId(
'Foo' );
162 $acme->setGlobalId(
'acme.com' );
163 $acme->setGroup(
'Test' );
168 $dewiki->setGlobalId(
'dewiki' );
169 $dewiki->setGroup(
'wikipedia' );
170 $dewiki->setForward(
true );
174 $dewiki->setPath( MediaWikiSite::PATH_PAGE,
'http://de.wikipedia.org/wiki/' );
175 $dewiki->setSource(
'meta.wikimedia.org' );
179 $file = __DIR__ .
'/SiteImporterTest.xml';
180 $importer->importFromFile( $file );
191 foreach ( $sites as $site ) {
192 $key = $site->getGlobalId();
unserialize( $serialized)
and that you know you can do these things To protect your we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights These restrictions translate to certain responsibilities for you if you distribute copies of the or if you modify it For if you distribute copies of such a whether gratis or for a you must give the recipients all the rights that you have You must make sure that receive or can get the source code And you must show them these terms so they know their rights We protect your rights with two and(2) offer you this license which gives you legal permission to copy
they could even be mouse clicks or menu items whatever suits your program You should also get your if any
assertSitesEqual( $expected, $actual, $message='')
getSerializedSiteList( $sites)
testImportFromXML( $xml, array $expectedSites, $errorCount=0)
provideImportFromXML
newSiteImporter(array $expectedSites, $errorCount)
testImportFromXML_malformed()
static newForType( $siteType)
$data
Utility to generate mapping file used in mw.Title (phpCharToUpper.json)
The wiki should then use memcached to cache various data To use multiple just add more items to the array To increase the weight of a make its entry a array("192.168.0.1:11211", 2))
foreach( $res as $row) $serialized