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