public function testJSendError()
 {
     $thrownException = FALSE;
     try {
         $response = \Response::jsendError();
     } catch (Exception $e) {
         $thrownException = $e;
     }
     $this->assertInstanceOf('BadMethodCallException', $thrownException, 'JSend errors without messages should throw a BadMethodCallException.');
     $response = \Response::jsendError('mymessage', 123, (object) ['mydata' => 'thedata']);
     $this->assertEquals('error', $response->getData()->status);
     $this->assertEquals('mymessage', $response->getData()->message);
     $this->assertEquals(123, $response->getData()->code);
     $this->assertEquals('thedata', $response->getData()->data->mydata);
 }