create(); $this->actingAs($user); return $user; } public function test_requires_authentication(): void { $res = $this->getJson('/admin/movies/exists?provider_id=tt0000001'); $res->assertStatus(401); } public function test_reports_false_when_not_found(): void { $this->signIn(); $res = $this->getJson('/admin/movies/exists?provider_id=tt0000001'); $res->assertOk() ->assertJson([ 'exists' => false, ]); } public function test_reports_true_when_found(): void { $this->signIn(); $movie = Movie::factory()->create([ 'provider' => 'omdb', 'provider_id' => 'tt1234567', ]); $res = $this->getJson('/admin/movies/exists?provider_id=tt1234567'); $res->assertOk() ->assertJson([ 'exists' => true, 'movie_id' => $movie->id, ]); } }