Example #1
0
 public function testParseResponseWithResultAndErrorThrowsException()
 {
     $req = new Request();
     $req->setId('1');
     $resp = new Response();
     $resp->setRequest($req)->setResponseBody('{"id":"1","error":"error","result":{}}');
     $resp->setStrictMode(true);
     try {
         $resp->parseResponse();
     } catch (ResponseException $e) {
         $this->assertContains('must not exist', $e->getMessage());
         return;
     }
     $this->fail('Expecting exception.');
 }