withSession(['locale' => '-1 or 5*5=25 --']) ->get('/impressum'); $response->assertSuccessful(); }); it('applies a valid session locale', function () { $response = $this->withSession(['locale' => 'en']) ->get('/impressum'); $response->assertSuccessful(); expect(app()->getLocale())->toBe('en'); }); it('clears invalid session locale', function () { $this->withSession(['locale' => '-1 or 5*5=25 --']) ->get('/impressum'); expect(session('locale'))->toBeNull(); });