withHeaders([ 'Authorization' => $this->token, ])->get('/api/v2/course?view=create'); $response->assertOk(); $response = $this->withHeaders([ 'Authorization' => $this->token, ])->get('/api/v2/course?view=study'); $response->assertOk(); } public function test_store() { //testing store $response = $this->withHeaders([ 'Authorization' => $this->token, ])->json('POST', '/api/v2/course', [ 'title'=>'course1', 'studio'=>'visuddhinanda' ]); $response->assertOk(); } public function test_delete(){ //testing delete $member = Course::where('title','course1') ->first(); $response = $this->withHeaders([ 'Authorization' => $this->token, ])->delete('/api/v2/course/'.$member->id); $response->assertOk(); } }