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