mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-07-22 03:44:57 +02:00
Applied rector suggestions
This commit is contained in:
parent
4106bcef5f
commit
20f32c7f12
170 changed files with 808 additions and 761 deletions
|
@ -119,15 +119,15 @@ class PartLotWithdrawAddHelperTest extends WebTestCase
|
|||
{
|
||||
//Add 5 to lot 1
|
||||
$this->service->add($this->partLot1, 5, "Test");
|
||||
$this->assertSame(15.0, $this->partLot1->getAmount());
|
||||
$this->assertEqualsWithDelta(15.0, $this->partLot1->getAmount(), PHP_FLOAT_EPSILON);
|
||||
|
||||
//Add 3.2 to lot 2
|
||||
$this->service->add($this->partLot2, 3.2, "Test");
|
||||
$this->assertSame(5.0, $this->partLot2->getAmount());
|
||||
$this->assertEqualsWithDelta(5.0, $this->partLot2->getAmount(), PHP_FLOAT_EPSILON);
|
||||
|
||||
//Add 1.5 to lot 3
|
||||
$this->service->add($this->partLot3, 1.5, "Test");
|
||||
$this->assertSame(2.0, $this->partLot3->getAmount());
|
||||
$this->assertEqualsWithDelta(2.0, $this->partLot3->getAmount(), PHP_FLOAT_EPSILON);
|
||||
|
||||
}
|
||||
|
||||
|
@ -135,23 +135,23 @@ class PartLotWithdrawAddHelperTest extends WebTestCase
|
|||
{
|
||||
//Withdraw 5 from lot 1
|
||||
$this->service->withdraw($this->partLot1, 5, "Test");
|
||||
$this->assertSame(5.0, $this->partLot1->getAmount());
|
||||
$this->assertEqualsWithDelta(5.0, $this->partLot1->getAmount(), PHP_FLOAT_EPSILON);
|
||||
|
||||
//Withdraw 2.2 from lot 2
|
||||
$this->service->withdraw($this->partLot2, 2.2, "Test");
|
||||
$this->assertSame(0.0, $this->partLot2->getAmount());
|
||||
$this->assertEqualsWithDelta(0.0, $this->partLot2->getAmount(), PHP_FLOAT_EPSILON);
|
||||
}
|
||||
|
||||
public function testMove(): void
|
||||
{
|
||||
//Move 5 from lot 1 to lot 2
|
||||
$this->service->move($this->partLot1, $this->partLot2, 5, "Test");
|
||||
$this->assertSame(5.0, $this->partLot1->getAmount());
|
||||
$this->assertSame(7.0, $this->partLot2->getAmount());
|
||||
$this->assertEqualsWithDelta(5.0, $this->partLot1->getAmount(), PHP_FLOAT_EPSILON);
|
||||
$this->assertEqualsWithDelta(7.0, $this->partLot2->getAmount(), PHP_FLOAT_EPSILON);
|
||||
|
||||
//Move 2.2 from lot 2 to lot 3
|
||||
$this->service->move($this->partLot2, $this->partLot3, 2.2, "Test");
|
||||
$this->assertSame(5.0, $this->partLot2->getAmount());
|
||||
$this->assertSame(2.0, $this->partLot3->getAmount());
|
||||
$this->assertEqualsWithDelta(5.0, $this->partLot2->getAmount(), PHP_FLOAT_EPSILON);
|
||||
$this->assertEqualsWithDelta(2.0, $this->partLot3->getAmount(), PHP_FLOAT_EPSILON);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue