withHeaders([ 'Authorization' => 'Bearer ' . $this->getToken(), ])->post('/api/post', [ 'h' => 'entry', 'bookmark-of' => 'https://example.org/blog-post', ]); $response->assertJson(['response' => 'created']); Queue::assertPushed(ProcessBookmark::class); $this->assertDatabaseHas('bookmarks', ['url' => 'https://example.org/blog-post']); } public function test_screenshot_of_google() { $url = 'https://www.google.co.uk'; $uuid = (new \App\Services\BookmarkService())->saveScreenshot($url); $this->assertTrue(file_exists(public_path() . '/assets/img/bookmarks/' . $uuid . '.png')); } }