/** * @covers Devtools\Response::fail() * @expectedException \Exception **/ public function testFail() { $validResponse = json_encode(array('status' => '', 'request' => array(), 'message' => 'Error.' . "\n")); $response = new \Devtools\Response(); $response->fail("Error."); $this->assertEquals($validResponse, $response->json()); }
<?php $resp = new \Devtools\Response(); $resp->data($_REQUEST); $resp->message('This is a successful json call with which to test.'); echo $resp->json();