22
33namespace Tests ;
44
5- use Carbon \Carbon ;
65use Factories \StackkitCloudTaskFactory ;
76use Google \Cloud \Tasks \V2 \RetryConfig ;
7+ use Illuminate \Support \Carbon ;
88use Stackkit \LaravelGoogleCloudTasksQueue \CloudTasksApi ;
99use Stackkit \LaravelGoogleCloudTasksQueue \OpenIdVerificator ;
1010use Stackkit \LaravelGoogleCloudTasksQueue \StackkitCloudTask ;
@@ -34,7 +34,7 @@ public function test_loading_dashboard_works()
3434 public function it_counts_the_number_of_tasks ()
3535 {
3636 // Arrange
37- $ this -> travelTo (Carbon::parse ('2022-01-01 15:15:00 ' ));
37+ Carbon:: setTestNow (Carbon::parse ('2022-01-01 15:15:00 ' ));
3838 $ lastMinute = now ()->startOfMinute ()->subMinute ();
3939 $ thisMinute = now ()->startOfMinute ();
4040 $ thisHour = now ()->startOfHour ();
@@ -302,7 +302,7 @@ public function when_a_job_is_dispatched_it_will_be_added_to_the_monitor()
302302 public function when_a_job_is_running_it_will_be_updated_in_the_monitor ()
303303 {
304304 // Arrange
305- $ this -> travelTo (now ());
305+ \ Illuminate \ Support \Carbon:: setTestNow (now ());
306306 CloudTasksApi::fake ();
307307 OpenIdVerificator::fake ();
308308
@@ -328,7 +328,7 @@ public function when_a_job_is_running_it_will_be_updated_in_the_monitor()
328328 public function when_a_job_is_successful_it_will_be_updated_in_the_monitor ()
329329 {
330330 // Arrange
331- $ this -> travelTo (now ());
331+ \ Illuminate \ Support \Carbon:: setTestNow (now ());
332332 CloudTasksApi::fake ();
333333 OpenIdVerificator::fake ();
334334
@@ -354,7 +354,7 @@ public function when_a_job_is_successful_it_will_be_updated_in_the_monitor()
354354 public function when_a_job_errors_it_will_be_updated_in_the_monitor ()
355355 {
356356 // Arrange
357- $ this -> travelTo (now ());
357+ \ Illuminate \ Support \Carbon:: setTestNow (now ());
358358 CloudTasksApi::fake ();
359359 OpenIdVerificator::fake ();
360360
@@ -381,7 +381,7 @@ public function when_a_job_errors_it_will_be_updated_in_the_monitor()
381381 public function when_a_job_fails_it_will_be_updated_in_the_monitor ()
382382 {
383383 // Arrange
384- $ this -> travelTo (now ());
384+ \ Illuminate \ Support \Carbon:: setTestNow (now ());
385385 CloudTasksApi::fake ();
386386 OpenIdVerificator::fake ();
387387 CloudTasksApi::partialMock ()->shouldReceive ('getRetryConfig ' )->andReturn (
0 commit comments