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

update secured command test

This commit is contained in:
Austin Drummond
2023-12-20 00:08:05 -05:00
parent 86c40dd40c
commit 7dfc739502
2 changed files with 8 additions and 3 deletions

View File

@@ -284,7 +284,7 @@ function (ConsoleCommandEvent $event) {
->when($expiring, fn ($collection) => $collection->filter(fn ($row) => $row['exp'] < $now))
->map(function ($row) {
return [
'Site' => $row['host'],
'Site' => $row['site'],
'Valid Until' => $row['exp']->format('Y-m-d H:i:s T'),
];
})
@@ -310,7 +310,7 @@ function (ConsoleCommandEvent $event) {
exit;
}
$sites->each(function ($row) use ($expireIn) {
$url = Site::domain($row['host']);
$url = Site::domain($row['site']);
Site::unsecure($url);
Site::secure($url, null, $expireIn);

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']);