Laravel 5 如何在TDD测试中运行delete方法?

Laravel 5 如何在TDD测试中运行delete方法?,laravel-5,tdd,Laravel 5,Tdd,在laravel 5.8应用程序中,我对表、post、put请求的管理CRUD操作进行了TDD测试,但未能进行删除: public function testVoteCategoriesCrud() { $this->withoutExceptionHandling(); $this->withoutMiddleware(); $newVoteCategoryRow = factory('App\Vo

在laravel 5.8应用程序中,我对表、post、put请求的管理CRUD操作进行了TDD测试,但未能进行删除:

    public function testVoteCategoriesCrud()
    {

        $this->withoutExceptionHandling();
        $this->withoutMiddleware();

        $newVoteCategoryRow         = factory('App\VoteCategory')->make(); // Create new VoteCategory Data Row
        $newVoteCategoryRow->name   .= ' created on ' . strftime("%Y-%m-%d %H:%M:%S:%U") ;
        $new_vote_category_row_name = $newVoteCategoryRow->name;

        $response = $this->actingAs($loggedUser)->post('/admin/vote-categories', $newVoteCategoryRow->toArray());
        $this->assertCount( $original_vote_categories_count+1, VoteCategory::all() );    // to use HTTP_RESPONSE_OK
        $response->assertRedirect('/admin/vote-categories'); // after successful post request redirect to '/admin/vote-categories'

        ...
        $response = $this->actingAs($loggedUser)->delete( '/admin/vote-categories', ['id'=>$checkCreatedVoteCategory->id] );

        $this->assertCount( $original_vote_categories_count, VoteCategory::all() );    // to use HTTP_RESPONSE_OK
        $response->assertRedirect('/admin/vote-categories'); // after successful put request redirect to '/admin/vote-categories'

But I got error 
Symfony\Component\HttpKernel\Exception\MethodNotAllowedHttpException: The DELETE method is not supported for this route. Supported methods: GET, HEAD, POST.
在上面的删除方法上


如何正确地删除测试中的行?

我在routes/web.php中找到了添加delete方法的决定:

Route::resource('vote-categories', 'Admin\VoteCategoriesController', ['except' => []])->middleware('WorkTextString');
Route::delete('vote-categories', 'Admin\VoteCategoriesController@destroy');
这对我很有用