public function testShouldReturnFalseWhenCallForEmptyResponseIfIsOk() { // Set $response = new Response(); // Assert $this->assertFalse($response->isOk()); }
public function testCreateWithHttpErrorCode() { $code = 403; $rawResult = 'OK'; $response = new Response(); $response->create($code, $rawResult); $this->assertFalse($response->isOk()); $this->assertEquals($rawResult, $response->getRawResult()); $error = $response->getError(); $this->assertEquals('HTTP_CODE_ERROR', $error); }
/** * * @param \ifirma\Response $response * @throws IfirmaException */ private function _checkResponseAfterAccountancyMonthChange(Response $response) { if (!$response->isOk()) { throw new IfirmaException($response->getMessage()); } }