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

Merge pull request #1461 from adrum/feature/renew-certs

added the ability to renew certs and view their expiration dates
This commit is contained in:
Matt Stauffer
2023-12-20 22:44:43 -05:00
committed by GitHub
3 changed files with 84 additions and 7 deletions

View File

@@ -436,7 +436,12 @@ public function test_secured_command()
[$app, $tester] = $this->appAndTester();
$site = Mockery::mock(RealSite::class);
$site->shouldReceive('secured')->andReturn(['tighten.test']);
$site->shouldReceive('securedWithDates')->andReturn([
[
'site' => 'tighten.test',
'exp' => new DateTime('Aug 2 13:16:40 2024 GMT')
]
]);
swap(RealSite::class, $site);
$tester->run(['command' => 'secured']);
@@ -445,6 +450,22 @@ public function test_secured_command()
$this->assertStringContainsString('tighten.test', $tester->getDisplay());
}
public function test_renew_command()
{
[$app, $tester] = $this->appAndTester();
$site = Mockery::mock(RealSite::class);
$site->shouldReceive('renew')->andReturn();
swap(RealSite::class, $site);
$nginx = Mockery::mock(Nginx::class);
$nginx->shouldReceive('restart')->once();
swap(Nginx::class, $nginx);
$tester->run(['command' => 'renew']);
$tester->assertCommandIsSuccessful();
}
public function test_proxy_command()
{
[$app, $tester] = $this->appAndTester();