| Conditions | 1 |
| Paths | 1 |
| Total Lines | 25 |
| Code Lines | 15 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 3 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 18 | public function testDoQuery() { |
||
| 19 | $mock = new MockHandler( [ |
||
| 20 | new Response( |
||
| 21 | 200, |
||
| 22 | [], |
||
| 23 | json_encode( [ |
||
| 24 | 'status' => [ 'error' => 'OK' ], |
||
| 25 | 'items' => [ 42 ] |
||
| 26 | ] ) |
||
| 27 | ) |
||
| 28 | ] ); |
||
| 29 | $handler = HandlerStack::create( $mock ); |
||
| 30 | $client = new Client( [ 'handler' => $handler ] ); |
||
| 31 | $wikidataQueryApi = new WikidataQueryApi( '', $client ); |
||
| 32 | |||
| 33 | $this->assertEquals( |
||
| 34 | [ |
||
| 35 | 'status' => [ 'error' => 'OK' ], |
||
| 36 | 'items' => [ 42 ] |
||
| 37 | ], |
||
| 38 | $wikidataQueryApi->doQuery( [ |
||
| 39 | 'q' => 'claim[42:42]' |
||
| 40 | ] ) |
||
| 41 | ); |
||
| 42 | } |
||
| 43 | |||
| 64 |