tests/Feature/Admin/ManagePostsControllerTest.php
/**
     * Test trying to update a post which does not exist gives a 404 response.
     */
Test trying to update a post which does not exist gives a 404 response.
Test trying to update a post which does not exist gives a 404 response .
public function testUpdateInvalidPostID(): void
    {
        $invalidPostID = 10000;
        $this->beAdminUser();
        $params = factory(Post::class)->make()->toArray();
        $response = $this->patch(route('blogetc.admin.edit_post', $invalidPostID), $params);
        $response->assertNotFound();
    }
public function testUpdateInvalidPostID ( ) : void { $ invalidPostID = 10000 ; $ this -> beAdminUser ( ) ; $ params = factory ( Post :: class ) -> make ( ) -> toArray ( ) ; $ response = $ this -> patch ( route ( 'blogetc.admin.edit_post' , $ invalidPostID ) , $ params ) ; $ response -> assertNotFound ( ) ; }
Test trying to update a post which does not exist gives a 404 response.
Test trying to update a post which does not exist gives a 404 response .