public function testModelHTTPStatusSameAsExceptionHTTPStatus() { $message = uniqid('test:'); $e = new \ErrorException($message, HttpResponseType::INTERNAL_ERROR); $o = new ErrorModel($e); $this->assertEquals(HttpResponseType::INTERNAL_ERROR, $o->getHttpStatus()); }
public function testBasicSetException() { $e = new \Exception('initial', 0); $o = new ErrorModel($e); $this->assertSame($e, $o->getException()); $r = new ExceptionError('test', 1); $o->setException($r); $this->assertSame($r, $o->getException()); }
public function testModelMessageSameAsExceptionMessage() { $message = uniqid('test:'); $o = new ErrorModel(new \Exception($message, 1)); $this->assertEquals($message, $o->getMessage()); }
public function testGetExceptionAfterModelInitializedWithException() { $e = new Exception('test'); $o = new ErrorModel($e); $this->assertSame($e, $o->getException()); }
public function testCorrectInstantiationWithException() { $e = new Exception('test'); $o = new ErrorModel($e); $this->assertSame($e, $o->getException()); }