['environment' => 'production'], 'active-name' => ['database' => 'investemoz'], 'active-port' => ['port' => '5432'], 'remote-host' => ['host' => 'example.invalid'], 'database-url' => ['url' => 'postgresql://example.invalid/test'], 'other-driver' => ['driver' => 'sqlite']]; foreach ($migrations as $migration) { foreach ($cases as $name => $patch) { yield $migration.'/'.$name => [$migration, $patch]; } } } #[DataProvider('rejectedTargets')] public function test_new_qa_allowance_cannot_run_outside_the_isolated_target(string $migration, array $patch): void { $environment = $patch['environment'] ?? 'testing'; unset($patch['environment']); app()->instance('env', $environment); config(['database.default' => 'pgsql', 'database.connections.pgsql' => [...config('database.connections.pgsql'), 'driver' => 'pgsql', 'host' => '127.0.0.1', 'port' => '55441', 'database' => 'migration_guard_test', 'url' => null, ...$patch], 'investment-zone-profile.authenticated_installation' => false, 'investment-zone-details.authenticated_installation' => false, 'investor-context.authenticated_installation' => false, 'editorial.authenticated_installation' => false]); if (($patch['driver'] ?? '') === 'sqlite') { config(['database.default' => 'sqlite']); } DB::shouldReceive('selectOne')->never(); DB::shouldReceive('connection')->never(); $this->expectException(RuntimeException::class); (require database_path('migrations/'.$migration.'.php'))->up(); } }