diff --git a/tests/DataTables/Filters/CompoundFilterTraitTest.php b/tests/DataTables/Filters/CompoundFilterTraitTest.php index e52911eb..1249cfa2 100644 --- a/tests/DataTables/Filters/CompoundFilterTraitTest.php +++ b/tests/DataTables/Filters/CompoundFilterTraitTest.php @@ -74,10 +74,7 @@ class CompoundFilterTraitTest extends TestCase 'filter3' => $f3 ], $result); } - - /** - * @doesNotPerformAssertions - */ + public function testApplyAllChildFilters(): void { $f1 = $this->createMock(FilterInterface::class); diff --git a/tests/Helpers/Projects/ProjectBuildRequestTest.php b/tests/Helpers/Projects/ProjectBuildRequestTest.php index 49bfede7..801efd4b 100644 --- a/tests/Helpers/Projects/ProjectBuildRequestTest.php +++ b/tests/Helpers/Projects/ProjectBuildRequestTest.php @@ -118,8 +118,8 @@ class ProjectBuildRequestTest extends TestCase //The values should be already prefilled correctly $request = new ProjectBuildRequest($this->project1, 10); //We need totally 20: Take 10 from the first (maximum 10) and 10 from the second (maximum 20) - $this->assertSame(10, $request->getLotWithdrawAmount($this->lot1a)); - $this->assertSame(10, $request->getLotWithdrawAmount($this->lot1b)); + $this->assertSame(10.0, $request->getLotWithdrawAmount($this->lot1a)); + $this->assertSame(10.0, $request->getLotWithdrawAmount($this->lot1b)); //If the needed amount is higher than the maximum, we should get the maximum $this->assertSame(2.5, $request->getLotWithdrawAmount($this->lot2)); @@ -140,9 +140,9 @@ class ProjectBuildRequestTest extends TestCase public function testGetNeededAmountForBOMEntry(): void { $build_request = new ProjectBuildRequest($this->project1, 5); - $this->assertSame(10, $build_request->getNeededAmountForBOMEntry($this->bom_entry1a)); + $this->assertSame(10.0, $build_request->getNeededAmountForBOMEntry($this->bom_entry1a)); $this->assertSame(7.5, $build_request->getNeededAmountForBOMEntry($this->bom_entry1b)); - $this->assertSame(20, $build_request->getNeededAmountForBOMEntry($this->bom_entry1c)); + $this->assertSame(20.0, $build_request->getNeededAmountForBOMEntry($this->bom_entry1c)); } public function testGetSetLotWithdrawAmount(): void @@ -154,8 +154,8 @@ class ProjectBuildRequestTest extends TestCase $build_request->setLotWithdrawAmount($this->lot1b->getID(), 3); //And it should be possible to get the amount via the lot object or via the ID - $this->assertSame(2, $build_request->getLotWithdrawAmount($this->lot1a->getID())); - $this->assertSame(3, $build_request->getLotWithdrawAmount($this->lot1b)); + $this->assertSame(2.0, $build_request->getLotWithdrawAmount($this->lot1a->getID())); + $this->assertSame(3.0, $build_request->getLotWithdrawAmount($this->lot1b)); } public function testGetWithdrawAmountSum(): void @@ -166,7 +166,7 @@ class ProjectBuildRequestTest extends TestCase $build_request->setLotWithdrawAmount($this->lot1a, 2); $build_request->setLotWithdrawAmount($this->lot1b, 3); - $this->assertSame(5, $build_request->getWithdrawAmountSum($this->bom_entry1a)); + $this->assertSame(5.0, $build_request->getWithdrawAmountSum($this->bom_entry1a)); $build_request->setLotWithdrawAmount($this->lot2, 1.5); $this->assertSame(1.5, $build_request->getWithdrawAmountSum($this->bom_entry1b)); } diff --git a/tests/Services/Parts/PartLotWithdrawAddHelperTest.php b/tests/Services/Parts/PartLotWithdrawAddHelperTest.php index 090ccdfb..bbc9eb41 100644 --- a/tests/Services/Parts/PartLotWithdrawAddHelperTest.php +++ b/tests/Services/Parts/PartLotWithdrawAddHelperTest.php @@ -117,15 +117,15 @@ class PartLotWithdrawAddHelperTest extends WebTestCase { //Add 5 to lot 1 $this->service->add($this->partLot1, 5, "Test"); - $this->assertSame(15, $this->partLot1->getAmount()); + $this->assertSame(15.0, $this->partLot1->getAmount()); //Add 3.2 to lot 2 $this->service->add($this->partLot2, 3.2, "Test"); - $this->assertSame(5, $this->partLot2->getAmount()); + $this->assertSame(5.0, $this->partLot2->getAmount()); //Add 1.5 to lot 3 $this->service->add($this->partLot3, 1.5, "Test"); - $this->assertSame(2, $this->partLot3->getAmount()); + $this->assertSame(2.0, $this->partLot3->getAmount()); } @@ -133,23 +133,23 @@ class PartLotWithdrawAddHelperTest extends WebTestCase { //Withdraw 5 from lot 1 $this->service->withdraw($this->partLot1, 5, "Test"); - $this->assertSame(5, $this->partLot1->getAmount()); + $this->assertSame(5.0, $this->partLot1->getAmount()); //Withdraw 2.2 from lot 2 $this->service->withdraw($this->partLot2, 2.2, "Test"); - $this->assertSame(0, $this->partLot2->getAmount()); + $this->assertSame(0.0, $this->partLot2->getAmount()); } public function testMove(): void { //Move 5 from lot 1 to lot 2 $this->service->move($this->partLot1, $this->partLot2, 5, "Test"); - $this->assertSame(5, $this->partLot1->getAmount()); - $this->assertSame(7, $this->partLot2->getAmount()); + $this->assertSame(5.0, $this->partLot1->getAmount()); + $this->assertSame(7.0, $this->partLot2->getAmount()); //Move 2.2 from lot 2 to lot 3 $this->service->move($this->partLot2, $this->partLot3, 2.2, "Test"); - $this->assertSame(5, $this->partLot2->getAmount()); - $this->assertSame(2, $this->partLot3->getAmount()); + $this->assertSame(5.0, $this->partLot2->getAmount()); + $this->assertSame(2.0, $this->partLot3->getAmount()); } }