tests/Feature/Admin/ManagePostsControllerTest.php
/**
     * Assert that the index admin page is not accessible for guests.
     * (Via gate).
     */
Assert that the index admin page is not accessible for guests.
(Via gate).
Assert that the index admin page is not accessible for guests . ( Via gate ) .
public function testForbiddenToNonAdminUsers(): void
    {
        $this->beNonAdminUser();
        $response = $this->get(route('blogetc.admin.index'));
        $response->assertForbidden();
    }
public function testForbiddenToNonAdminUsers ( ) : void { $ this -> beNonAdminUser ( ) ; $ response = $ this -> get ( route ( 'blogetc.admin.index' ) ) ; $ response -> assertForbidden ( ) ; }
Assert that the index admin page is not accessible for guests.
Assert that the index admin page is not accessible for guests .