Skip to content

Commit 2b8b28f

Browse files
committed
Improbved tests for getLastSchedule
1 parent b5ffa99 commit 2b8b28f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

tests/CronJobTest.php

+4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace RenokiCo\PhpK8s\Test;
44

5+
use Carbon\Carbon;
56
use Cron\CronExpression;
67
use RenokiCo\PhpK8s\Exceptions\KubernetesAPIException;
78
use RenokiCo\PhpK8s\K8s;
@@ -155,6 +156,9 @@ public function runCreationTests()
155156
sleep(1);
156157
$job->refresh();
157158
}
159+
160+
$this->assertInstanceOf(Carbon::class, $cronjob->getLastSchedule());
161+
$this->assertTrue($cronjob->getLastSchedule()->gt(Carbon::now()->subSeconds(60)));
158162
}
159163

160164
public function runGetAllTests()

0 commit comments

Comments
 (0)