Conditions | 1 |
Paths | 1 |
Total Lines | 19 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Changes | 3 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
44 | public function testDoQueryWithError() { |
||
45 | $mock = new MockHandler( [ |
||
46 | new Response( |
||
47 | 200, |
||
48 | [], |
||
49 | json_encode( [ |
||
50 | 'status' => [ 'error' => 'Error' ] |
||
51 | ] ) |
||
52 | ) |
||
53 | ] ); |
||
54 | $handler = HandlerStack::create( $mock ); |
||
55 | $client = new Client( [ 'handler' => $handler ] ); |
||
56 | $wikidataQueryApi = new WikidataQueryApi( '', $client ); |
||
57 | |||
58 | $this->setExpectedException( 'WikidataQueryApi\WikibaseQueryApiException' ); |
||
59 | $wikidataQueryApi->doQuery( [ |
||
60 | 'q' => 'claim[42:42]' |
||
61 | ] ); |
||
62 | } |
||
63 | } |
||
64 |