Routes
Route::group(array('prefix' => 'api'), function() { Route::resource('test', 'TestController', array('only' => array('index', 'store', 'destroy', 'show', 'update'))); });
controller
public function store(Request $request) { return response()->json(['status' => true]); }
Device class
public function testBasicExample() { $this->post('api/test')->seeJson(['status' => true]); }
PHPUnit result:
1) ExampleTest::testBasicExample
Invalid JSON was returned from the route.
Perhaps an exception was thrown? Does anyone see a problem?
source share