File tree Expand file tree Collapse file tree 2 files changed +48
-4
lines changed Expand file tree Collapse file tree 2 files changed +48
-4
lines changed Original file line number Diff line number Diff line change @@ -117,10 +117,7 @@ private function getImportedEntityMappingStore() {
117117 private function newEntityDeserializer () {
118118 $ wikibaseRepo = WikibaseRepo::getDefaultInstance ();
119119
120- $ deserializerFactory = new DeserializerFactory (
121- $ wikibaseRepo ->getDataValueDeserializer (),
122- $ wikibaseRepo ->getEntityIdParser ()
123- );
120+ $ deserializerFactory = $ wikibaseRepo ->getExternalFormatDeserializerFactory ();
124121
125122 return $ deserializerFactory ->newEntityDeserializer ();
126123 }
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace Wikibase \Import \Tests ;
4+
5+ use Monolog \Logger ;
6+ use Monolog \Handler \NullHandler ;
7+ use Wikibase \Import \EntityImporter ;
8+ use Wikibase \Import \EntityImporterFactory ;
9+ use Wikibase \Repo \WikibaseRepo ;
10+
11+ /**
12+ * @group WikibaseImport
13+ */
14+ class EntityImporterFactoryTest extends \PHPUnit_Framework_TestCase {
15+
16+ public function testNewEntityImporter () {
17+ $ entityImporterFactory = $ this ->newEntityImporterFactory ();
18+
19+ $ entityImporter = $ entityImporterFactory ->newEntityImporter ();
20+
21+ $ this ->assertInstanceOf ( 'Wikibase\Import\EntityImporter ' , $ entityImporter );
22+ }
23+
24+ public function testGetApiEntityLookup () {
25+ $ entityImporterFactory = $ this ->newEntityImporterFactory ();
26+
27+ $ apiEntityLookup = $ entityImporterFactory ->getApiEntityLookup ();
28+
29+ $ this ->assertInstanceOf ( 'Wikibase\Import\ApiEntityLookup ' , $ apiEntityLookup );
30+ }
31+
32+ private function newEntityImporterFactory () {
33+ return new EntityImporterFactory (
34+ WikibaseRepo::getDefaultInstance ()->getStore ()->getEntityStore (),
35+ wfGetLB (),
36+ $ this ->newLogger (),
37+ 'https://www.wikidata.org/w/api.php '
38+ );
39+ }
40+
41+ private function newLogger () {
42+ $ logger = new Logger ( 'wikibase-import ' );
43+ $ logger ->pushHandler ( new NullHandler () );
44+
45+ return $ logger ;
46+ }
47+ }
You can’t perform that action at this time.
0 commit comments