5
Yollarılaravel 5 PHPUnit - Geçersiz JSON rotadan
Route::group(array('prefix' => 'api'), function() {
Route::resource('test', 'TestController', array('only' => array('index', 'store', 'destroy', 'show', 'update')));
});
Kontrolör
public function store(Request $request) {
return response()->json(['status' => true]);
}
Birim Sınıf
public function testBasicExample() {
$this->post('api/test')->seeJson(['status' => true]);
}
P iade edildi HPUnit Sonuç:
1) ExampleTest::testBasicExample
Geçersiz JSON yol döndürüldü.
Belki de bir istisna atılmış olabilir? Problemi gören var mı?
Ahh teşekkür ederim. çalışır: D – Cas
atılan istisna görmek için bir yolu var mı? – whiterook6
İstisnai görmek için: $ this-> json ('POST', 'api/test'); dd ($ this-> response-> getContent()); – Aine