tests/Feature/Admin/ManagePostsControllerTest.php
/**
     * Test can delete a post.
     */
Test can delete a post.
Test can delete a post .
public function testDestroy(): void
    {
        $this->beAdminUser();
        $post = factory(Post::class)->create();
        $response = $this->delete(route('blogetc.admin.destroy_post', $post));
        $response->assertOk()->assertViewIs('blogetc_admin::posts.deleted_post');
        $this->assertDatabaseMissing('blog_etc_posts', ['id' => $post->id]);
    }
public function testDestroy ( ) : void { $ this -> beAdminUser ( ) ; $ post = factory ( Post :: class ) -> create ( ) ; $ response = $ this -> delete ( route ( 'blogetc.admin.destroy_post' , $ post ) ) ; $ response -> assertOk ( ) -> assertViewIs ( 'blogetc_admin::posts.deleted_post' ) ; $ this -> assertDatabaseMissing ( 'blog_etc_posts' , [ 'id' => $ post -> id ] ) ; }
Test can delete a post.
Test can delete a post .