1
0
mirror of https://github.com/laravel/valet.git synced 2026-02-08 17:20:08 +01:00

Ensure base configuration is correct even if file already exists

This commit is contained in:
Matt Stauffer
2023-05-16 08:23:41 -04:00
parent a4145d77b5
commit 9ce0ca97b2
3 changed files with 31 additions and 5 deletions

View File

@@ -132,4 +132,14 @@ public function test_trust_adds_the_sudoer_files()
resolve(Brew::class)->createSudoersEntry();
resolve(Valet::class)->createSudoersEntry();
}
public function test_ensure_configuration_exists_writes_tld_and_loopback_if_empty()
{
$config = Mockery::mock(Configuration::class.'[writeBaseConfiguration,read,updateKey]', [new Filesystem]);
$config->shouldReceive('writeBaseConfiguration')->once();
$config->shouldReceive('read')->times(2)->andReturn([]);
$config->shouldReceive('updateKey')->with('tld', 'test');
$config->shouldReceive('updateKey')->with('loopback', '127.0.0.1');
$config->ensureBaseConfiguration();
}
}