* @author Bernhard Posselt * @copyright Alessandro Cosentino 2012 * @copyright Bernhard Posselt 2012, 2014 */ namespace OCA\News\Controller; class Test { use JSONHttpError; } class JSONHttpErrorTest extends \PHPUnit_Framework_TestCase { public function testError() { $ex = new \Exception('hi'); $test = new Test(); $result = $test->error($ex, 3); $this->assertEquals(['message' => 'hi'], $result->getData()); $this->assertEquals(3, $result->getStatus()); } }