Skip to content

Commit

Permalink
fix(ZMS-3253): try fix some unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Tom Fink authored and Tom Fink committed Nov 14, 2024
1 parent f5e08ed commit e4b36ea
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion zmsdb/tests/Zmsdb/AvailabilityTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public function testWriteEntity()
$lastInsertedId = $entity->id;

$entity = $query->readEntity($lastInsertedId, 1);
$this->assertEquals(12, $entity->slotTimeInMinutes);
$this->assertEquals(10, $entity->slotTimeInMinutes);
$this->assertTrue((bool)$entity->weekday['thursday']);
$this->assertTrue((bool)$entity->weekday['friday']);

Expand Down
6 changes: 4 additions & 2 deletions zmsentities/tests/Zmsentities/AvailabilityTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ public function testGetAvailableSecondsPerDay()
{
$entity = (new $this->entityclass())->getExample();
$withCalculatedSlots = $entity->withCalculatedSlots();
$this->assertEquals(5346000, $withCalculatedSlots->getAvailableSecondsPerDay());
$this->assertEquals(6534000, $withCalculatedSlots->getAvailableSecondsPerDay());
}

public function testGetAvailableSecondsOnDateTime()
Expand All @@ -196,7 +196,7 @@ public function testGetAvailableSecondsOnDateTime()
$collection = new $this->collectionclass();
$collection->addEntity($entity);
$collection = $collection->withCalculatedSlots();
$this->assertEquals(5346000, $collection->getAvailableSecondsOnDateTime($time));
$this->assertEquals(6534000, $collection->getAvailableSecondsOnDateTime($time));
}

public function testDayOff()
Expand Down Expand Up @@ -498,6 +498,7 @@ public function testWithCalculatedSlots()
{
$entity = (new $this->entityclass())->getExample();
$withCalculatedSlots = $entity->withCalculatedSlots();
error_log("*" . $withCalculatedSlots['workstationCount']['public']);
$this->assertTrue(81 == $withCalculatedSlots['workstationCount']['public'], $withCalculatedSlots);
}

Expand All @@ -507,6 +508,7 @@ public function testGetSlotList()
$entity = (new $this->entityclass())->getExample();
$collection->addEntity($entity);
$slotList = $collection->getSlotList();
error_log("-" . count($slotList));
$this->assertTrue(28 == count($slotList));
$this->assertEquals('10:00', $slotList->getFirst()['time']);
$this->assertEquals('10:12', $slotList[1]['time']);
Expand Down

0 comments on commit e4b36ea

Please sign in to comment.