Conditions | 1 |
Paths | 1 |
Total Lines | 23 |
Code Lines | 13 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
27 | public function testGetUrl() |
||
28 | { |
||
29 | $jsonFixture = file_get_contents(__DIR__.'/fixture_WD_ISNI.json'); |
||
30 | |||
31 | $mock = new MockHandler( |
||
32 | [ |
||
33 | new Response(200, ['X-Foo' => 'Bar'], $jsonFixture), |
||
34 | ] |
||
35 | ); |
||
36 | $handler = HandlerStack::create($mock); |
||
37 | $clientMocked = new Client(['handler' => $handler]); |
||
38 | |||
39 | $wikidata = new WikidataAdapter($clientMocked); |
||
40 | $actual = $wikidata->searchByISNI('0000 0001 2137 320X'); |
||
41 | |||
42 | $this::assertSame( |
||
43 | 'https://fr.wikipedia.org/wiki/Michel_Houellebecq', |
||
44 | $actual['article']['value'] |
||
45 | ); |
||
46 | |||
47 | $this::assertSame( |
||
48 | '66522427', |
||
49 | $actual['viaf']['value'] |
||
50 | ); |
||
53 |