Exemple #1
0
 function testDefaultError()
 {
     $api = new Api();
     $req = new Request();
     $resp = new Response();
     $ex = new Exception("Blah");
     $srvc = new Services();
     $api->defaultError($req, $resp, $srvc, $ex);
     $this->assertEquals(500, $resp->getStatus());
     $this->assertEquals("text/html", $resp->getHeader("Content-Type"));
     $this->assertEquals("<pre>{$ex}</pre>", $resp->getBody());
 }