mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2026-02-15 14:09:36 +00:00
Added test for stocktake method on PartLotWithdrawAddHelper
This commit is contained in:
parent
d8fdaa9529
commit
3c87fe0932
1 changed files with 15 additions and 0 deletions
|
|
@ -154,4 +154,19 @@ class PartLotWithdrawAddHelperTest extends WebTestCase
|
|||
$this->assertEqualsWithDelta(5.0, $this->partLot2->getAmount(), PHP_FLOAT_EPSILON);
|
||||
$this->assertEqualsWithDelta(2.0, $this->partLot3->getAmount(), PHP_FLOAT_EPSILON);
|
||||
}
|
||||
|
||||
public function testStocktake(): void
|
||||
{
|
||||
//Stocktake lot 1 to 20
|
||||
$this->service->stocktake($this->partLot1, 20, "Test");
|
||||
$this->assertEqualsWithDelta(20.0, $this->partLot1->getAmount(), PHP_FLOAT_EPSILON);
|
||||
$this->assertNotNull($this->partLot1->getLastStocktakeAt()); //Stocktake date should be set
|
||||
|
||||
//Stocktake lot 2 to 5
|
||||
$this->partLot2->setInstockUnknown(true);
|
||||
$this->service->stocktake($this->partLot2, 0, "Test");
|
||||
$this->assertEqualsWithDelta(0.0, $this->partLot2->getAmount(), PHP_FLOAT_EPSILON);
|
||||
$this->assertFalse($this->partLot2->isInstockUnknown()); //Instock unknown should be cleared
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue