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:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user