Example #1
0
 public function testModelHTTPStatusSameAsExceptionHTTPStatus()
 {
     $message = uniqid('test:');
     $e = new \ErrorException($message, HttpResponseType::INTERNAL_ERROR);
     $o = new ErrorModel($e);
     $this->assertEquals(HttpResponseType::INTERNAL_ERROR, $o->getHttpStatus());
 }
Example #2
0
 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());
 }
Example #3
0
 public function testModelMessageSameAsExceptionMessage()
 {
     $message = uniqid('test:');
     $o = new ErrorModel(new \Exception($message, 1));
     $this->assertEquals($message, $o->getMessage());
 }
Example #4
0
 public function testGetExceptionAfterModelInitializedWithException()
 {
     $e = new Exception('test');
     $o = new ErrorModel($e);
     $this->assertSame($e, $o->getException());
 }
Example #5
0
 public function testCorrectInstantiationWithException()
 {
     $e = new Exception('test');
     $o = new ErrorModel($e);
     $this->assertSame($e, $o->getException());
 }