1
0
mirror of https://github.com/laravel/valet.git synced 2026-02-06 16:50:09 +01:00

Merge branch 'master' into feature/links-with-parked

This commit is contained in:
James Barnard
2019-10-04 07:30:35 +01:00
3 changed files with 42 additions and 4 deletions

View File

@@ -28,6 +28,28 @@ public function tearDown()
}
public function test_get_certificates_will_return_with_multi_segment_tld()
{
$files = Mockery::mock(Filesystem::class);
$files->shouldReceive('scandir')
->once()
->with($certPath = '/Users/testuser/.config/valet/Certificates')
->andReturn(['helloworld.multi.segment.tld.com.crt']);
$config = Mockery::mock(Configuration::class);
$config->shouldReceive('read')
->once()
->andReturn(['tld' => 'multi.segment.tld.com']);
swap(Filesystem::class, $files);
swap(Configuration::class, $config);
/** @var Site $site */
$site = resolve(Site::class);
$certs = $site->getCertificates($certPath);
$this->assertSame(['helloworld' => 0], $certs->all());
}
public function test_get_sites_will_return_if_secured()
{
$files = Mockery::mock(Filesystem::class);
@@ -206,6 +228,12 @@ public function test_certificates_trim_tld_for_custom_tlds()
'fiveletters.local.crt',
]);
$config = Mockery::mock(Configuration::class);
$config->shouldReceive('read')
->once()
->andReturn(['tld' => 'other']);
swap(Configuration::class, $config);
swap(Filesystem::class, $files);
$site = resolve(Site::class);