예제 #1
0
 public function testExceptions()
 {
     $cubex = new Cubex();
     $exception = new \Exception("Test Exception", 345);
     $resp = $cubex->exceptionResponse($exception);
     $this->assertInstanceOf('Symfony\\Component\\HttpFoundation\\Response', $resp);
     $this->assertContains('An uncaught exception was thrown', (string) $resp);
     $this->assertContains('Test Exception', (string) $resp);
     $this->assertContains('345', (string) $resp);
     $exception = CubexException::debugException("msg", 123, 'solution');
     $resp = $cubex->exceptionResponse($exception);
     $this->assertContains('msg', (string) $resp);
     $this->assertContains('123', (string) $resp);
     $this->assertContains('solution', (string) $resp);
 }