示例#1
0
文件: AppTest.php 项目: ovide/phest
 public function testErrorHandlerInDevMode()
 {
     $this->app->getEventsManager()->attach('micro', function (\Phalcon\Events\Event $evt, App $app) {
         if ($evt->getType() === 'beforeHandleRoute') {
             throw new \Exception('foo', 555, new \Exception('bar', 444));
         }
     });
     $this->app->devEnv = true;
     $response = $this->app->handle('/');
     $actualContent = json_decode($response->getContent());
     $this->assertEquals(555, $actualContent->code);
     $this->assertEquals('foo', $actualContent->message);
     $this->assertEquals('Exception', $actualContent->type);
     $this->assertInternalType('array', $actualContent->trace);
     $this->assertEquals('500 foo', $response->getHeaders()->get('Status'));
 }