如何在 Laravel 5.5 中正确编写控制器方法的单元测试?

How to correctly write a unit test for controllers methods in Laravel 5.5?

请检查我在控制器中使用的代码:

class ObjectsPagesController extends Controller
{
    public function destroy(Destroy $destroy, $id)
    {
        $objectsPage = ObjectsPages::with( 'ObjectsPagesRelation')->where('group_id', $id)->first();
        if (isset($objectsPage)) {

            $objectsPage->delete();
            $objectsPage->ObjectsPagesRelation()->delete();
            return redirect()->route('objects.pages.index')->with('success', 'done');  

        }else{
            abort(404);
        }
    }
}

在我的请求页面上,我写了以下代码:

class Destroy extends FormRequest
{
    public function authorize()
    {
        return Auth::user()->can('del_objects_pages');
    }
    public function rules()
    {
        return [
            //
        ];
    }
}

我尝试如下所示的 artisan 命令

php artisan make:test Pages --unit`

但是找不到明确的说明laravel 5.5下一步该做什么?

<?php 
  class StoreObjectPageTest extends TestCase
{
    public function testStoreObjectIsCreated()
    {
        $this->actingAs($someUser)->post('/some/url');

        $this->assertDatabaseHas('store_objects', [
            // The attributes of a row you're expecting to see in DB
        ]);
    }
}
?>