Example #1
0
 /**
  * test failure() method
  *
  * @test
  */
 public function failure()
 {
     $this->generateComponent();
     $this->Api->failure(ApiError::VALIDATION_ERROR);
     $this->assertSame(['success' => false, 'code' => 500, 'errorCode' => ApiError::VALIDATION_ERROR, 'errorMessage' => ApiError::message(ApiError::VALIDATION_ERROR)], $this->Api->getResponse());
     $this->generateComponent();
     $this->Api->failure(ApiError::VALIDATION_ERROR, 501);
     $this->assertSame(501, $this->Api->getResponse()['code']);
 }