BadIpBlocker::class]; } protected function defineEnvironment($app): void { $this->storageDir = sys_get_temp_dir().'/bad-ip-blocker-tests-'.bin2hex(random_bytes(4)); $app['config']->set('bad-ip-blocker.storage_path', $this->storageDir.'/bad-ips.json'); $app['config']->set('cache.default', 'array'); } protected function defineRoutes($router): void { $router->get('/', fn () => 'ok'); } protected function tearDown(): void { File::deleteDirectory($this->storageDir); parent::tearDown(); } protected function getFrom(string $uri, string $ip) { return $this->withServerVariables(['REMOTE_ADDR' => $ip])->get($uri); } }