예제 #1
0
 public function testReturnsJsonResponse()
 {
     $response = new JsonResponse(['foo' => 'bar']);
     $this->assertEquals('{"foo":"bar"}', $response->getContent());
     $this->assertEquals('application/json', $response->getContentType());
     $responseJson = Response::json(['foo' => 'bar']);
     $this->assertEquals('{"foo":"bar"}', $responseJson->getContent());
     $this->assertEquals('application/json', $responseJson->getContentType());
 }
 /**
  * Destroy the session and Logout the user.
  *
  * @return \Cygnite\Http\Responses\JsonResponse
  */
 public function logoutAction()
 {
     $this->auth->logout(false);
     return Response::json(['status' => true, 'user' => []]);
 }