Skip to content

Commit

Permalink
feat(ZMS-3519) Unit-test fixing
Browse files Browse the repository at this point in the history
  • Loading branch information
MoDaae committed Feb 4, 2025
1 parent bd5a964 commit 45f93b9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion zmsentities/src/Zmsentities/Process.php
Original file line number Diff line number Diff line change
Expand Up @@ -592,14 +592,14 @@ public function getArrivalTime($default = 'now', $timezone = null)
$arrivalTime = 0;
}

$arrivalTime = (int)$arrivalTime;
$arrivalDateTime = Helper\DateTime::create($default, $timezone);
if ($arrivalTime) {
$arrivalDateTime = $arrivalDateTime->setTimestamp($arrivalTime);
}
return $arrivalDateTime;
}


public function setArrivalTime(\DateTimeInterface $dateTime = null)
{
$this->queue['arrivalTime'] = ($dateTime) ? $dateTime->getTimestamp() : 0;
Expand Down
6 changes: 3 additions & 3 deletions zmsentities/tests/Zmsentities/ProcessTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ public function testGetWaitedSeconds()
{
$entity = $this->getExample();
$seconds = $entity->getWaitedSeconds();
$this->assertEquals(53767, $seconds);
$this->assertEquals(45, $seconds);
$entity->queue->withAppointment = 0;
$entity->getFirstAppointment()->setDateByString('2016-04-01 00:00');
$seconds = $entity->getWaitedSeconds();
Expand All @@ -170,7 +170,7 @@ public function testGetWaitedMinutes()
{
$entity = $this->getExample();
$minutes = $entity->getWaitedMinutes();
$this->assertEquals(896.1167, round($minutes, 4));
$this->assertEquals(0.75, round($minutes, 4));
$entity->queue->withAppointment = 0;
$entity->getFirstAppointment()->setDateByString('2016-04-01 00:00');
$minutes = $entity->getWaitedMinutes();
Expand Down Expand Up @@ -378,7 +378,7 @@ public function testCollection()

$queueList = $collection->toQueueList($now);
$this->assertEquals('queued', $queueList->getFirst()->status);
$this->assertEquals('1447869171', $queueList->getFirst()->arrivalTime);
$this->assertEquals('1447922893', $queueList->getFirst()->arrivalTime);

$entity3 = $this->getExample();
$entity3->queue['waitingTimeEstimate'] = 60;
Expand Down

0 comments on commit 45f93b9

Please sign in to comment.