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

added renew test

This commit is contained in:
Austin Drummond
2023-12-20 00:18:24 -05:00
parent dc24a8ddc0
commit dce796ac01

View File

@@ -450,6 +450,31 @@ 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('securedWithDates')->andReturn([
[
'site' => 'tighten.test',
'exp' => new DateTime('Aug 2 13:16:40 2023 GMT')
]
]);
$site->shouldReceive('domain')->with('tighten.test')->andReturn('tighten.test');
$site->shouldReceive('secure')->with('tighten.test', null, 368)->once();
swap(RealSite::class, $site);
$nginx = Mockery::mock(Nginx::class);
$nginx->shouldReceive('restart')->once();
swap(Nginx::class, $nginx);
$tester->run(['command' => 'renew']);
$tester->assertCommandIsSuccessful();
$this->assertStringContainsString('tighten.test', $tester->getDisplay());
}
public function test_proxy_command()
{
[$app, $tester] = $this->appAndTester();