fix: harden postcodes:import against duplicate headers and test collisions
This commit is contained in:
@@ -5,12 +5,14 @@ use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||
|
||||
uses(RefreshDatabase::class);
|
||||
|
||||
function writeOnspdFixture(string $contents): string
|
||||
{
|
||||
$path = tempnam(sys_get_temp_dir(), 'onspd_').'.csv';
|
||||
file_put_contents($path, $contents);
|
||||
if (! function_exists('writeOnspdFixture')) {
|
||||
function writeOnspdFixture(string $contents): string
|
||||
{
|
||||
$path = tempnam(sys_get_temp_dir(), 'onspd_').'.csv';
|
||||
file_put_contents($path, $contents);
|
||||
|
||||
return $path;
|
||||
return $path;
|
||||
}
|
||||
}
|
||||
|
||||
it('imports active postcodes from an ONSPD CSV', function (): void {
|
||||
|
||||
Reference in New Issue
Block a user