@@ -60,8 +60,14 @@ public function testShouldCreateRootJobAndReturnIt()
6060
6161 $ this ->assertSame ($ job , $ result );
6262 $ this ->assertEquals (Job::STATUS_NEW , $ job ->getStatus ());
63- $ this ->assertEquals (new \DateTime (), $ job ->getCreatedAt (), '' , 1 );
64- $ this ->assertEquals (new \DateTime (), $ job ->getStartedAt (), '' , 1 );
63+ $ this ->assertEquals (
64+ (new \DateTime ())->getTimestamp (),
65+ $ job ->getCreatedAt ()->getTimestamp ()
66+ );
67+ $ this ->assertEquals (
68+ (new \DateTime ())->getTimestamp (),
69+ $ job ->getStartedAt ()->getTimestamp ()
70+ );
6571 $ this ->assertNull ($ job ->getStoppedAt ());
6672 $ this ->assertEquals ('job-name ' , $ job ->getName ());
6773 $ this ->assertEquals ('owner-id ' , $ job ->getOwnerId ());
@@ -183,7 +189,10 @@ public function testCreateChildJobShouldCreateAndSaveJobAndPublishRecalculateRoo
183189
184190 $ this ->assertSame ($ job , $ result );
185191 $ this ->assertEquals (Job::STATUS_NEW , $ job ->getStatus ());
186- $ this ->assertEquals (new \DateTime (), $ job ->getCreatedAt (), '' , 1 );
192+ $ this ->assertEquals (
193+ (new \DateTime ())->getTimestamp (),
194+ $ job ->getCreatedAt ()->getTimestamp ()
195+ );
187196 $ this ->assertNull ($ job ->getStartedAt ());
188197 $ this ->assertNull ($ job ->getStoppedAt ());
189198 $ this ->assertEquals ('job-name ' , $ job ->getName ());
@@ -256,7 +265,10 @@ public function testStartJobShouldUpdateJobWithRunningStatusAndStartAtTime()
256265 $ processor ->startChildJob ($ job );
257266
258267 $ this ->assertEquals (Job::STATUS_RUNNING , $ job ->getStatus ());
259- $ this ->assertEquals (new \DateTime (), $ job ->getStartedAt (), '' , 1 );
268+ $ this ->assertEquals (
269+ (new \DateTime ())->getTimestamp (),
270+ $ job ->getStartedAt ()->getTimestamp ()
271+ );
260272 }
261273
262274 public function testSuccessChildJobShouldThrowIfRootJob ()
@@ -325,7 +337,10 @@ public function testSuccessJobShouldUpdateJobWithSuccessStatusAndStopAtTime()
325337 $ processor ->successChildJob ($ job );
326338
327339 $ this ->assertEquals (Job::STATUS_SUCCESS , $ job ->getStatus ());
328- $ this ->assertEquals (new \DateTime (), $ job ->getStoppedAt (), '' , 1 );
340+ $ this ->assertEquals (
341+ (new \DateTime ())->getTimestamp (),
342+ $ job ->getStoppedAt ()->getTimestamp ()
343+ );
329344 }
330345
331346 public function testFailChildJobShouldThrowIfRootJob ()
@@ -394,7 +409,10 @@ public function testFailJobShouldUpdateJobWithFailStatusAndStopAtTime()
394409 $ processor ->failChildJob ($ job );
395410
396411 $ this ->assertEquals (Job::STATUS_FAILED , $ job ->getStatus ());
397- $ this ->assertEquals (new \DateTime (), $ job ->getStoppedAt (), '' , 1 );
412+ $ this ->assertEquals (
413+ (new \DateTime ())->getTimestamp (),
414+ $ job ->getStoppedAt ()->getTimestamp ()
415+ );
398416 }
399417
400418 public function testCancelChildJobShouldThrowIfRootJob ()
@@ -463,8 +481,14 @@ public function testCancelJobShouldUpdateJobWithCancelStatusAndStoppedAtTimeAndS
463481 $ processor ->cancelChildJob ($ job );
464482
465483 $ this ->assertEquals (Job::STATUS_CANCELLED , $ job ->getStatus ());
466- $ this ->assertEquals (new \DateTime (), $ job ->getStoppedAt (), '' , 1 );
467- $ this ->assertEquals (new \DateTime (), $ job ->getStartedAt (), '' , 1 );
484+ $ this ->assertEquals (
485+ (new \DateTime ())->getTimestamp (),
486+ $ job ->getStoppedAt ()->getTimestamp ()
487+ );
488+ $ this ->assertEquals (
489+ (new \DateTime ())->getTimestamp (),
490+ $ job ->getStartedAt ()->getTimestamp ()
491+ );
468492 }
469493
470494 public function testInterruptRootJobShouldThrowIfNotRootJob ()
@@ -536,7 +560,10 @@ public function testInterruptRootJobShouldUpdateJobAndSetInterruptedTrueAndStopp
536560 $ processor ->interruptRootJob ($ rootJob , true );
537561
538562 $ this ->assertTrue ($ rootJob ->isInterrupted ());
539- $ this ->assertEquals (new \DateTime (), $ rootJob ->getStoppedAt (), '' , 1 );
563+ $ this ->assertEquals (
564+ (new \DateTime ())->getTimestamp (),
565+ $ rootJob ->getStoppedAt ()->getTimestamp ()
566+ );
540567 }
541568
542569 /**
0 commit comments