Http::response(HttpRequestTestData::LATEST_RELEASE_BODY_NO_NEW_RELEASE), ]); } #[Test] public function test_landing_view_is_returned() { $response = $this->get('/'); $response->assertSuccessful() ->assertViewIs('landing'); } #[Test] public function test_landing_view_has_data() { $response = $this->get('/'); $response->assertViewHas('appSettings'); $response->assertViewHas('appConfig'); $response->assertViewHas('urls'); $response->assertViewHas('defaultPreferences'); $response->assertViewHas('subdirectory'); $response->assertViewHas('isDemoApp'); $response->assertViewHas('isTestingApp'); $response->assertViewHas('lang'); $response->assertViewHas('locales'); $response->assertViewHas('cspNonce'); $response->assertViewHas('isSecure'); } #[Test] public function test_calling_index_fires_ScanForNewReleaseCalled_event() { Event::fake(); $this->get('/'); Event::assertDispatched(ScanForNewReleaseCalled::class); } #[Test] public function test_calling_index_does_not_fire_ScanForNewReleaseCalled_event() { Event::fake(); Settings::set('checkForUpdate', false); $this->get('/'); Event::assertNotDispatched(ScanForNewReleaseCalled::class); } }