mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-07-12 11:24:31 +02:00
Applied rectors phpunit 9 migrations to tests
This commit is contained in:
parent
684334ba22
commit
fcbb1849ec
22 changed files with 162 additions and 187 deletions
|
@ -117,15 +117,15 @@ class PartLotWithdrawAddHelperTest extends WebTestCase
|
|||
{
|
||||
//Add 5 to lot 1
|
||||
$this->service->add($this->partLot1, 5, "Test");
|
||||
$this->assertEquals(15, $this->partLot1->getAmount());
|
||||
$this->assertSame(15, $this->partLot1->getAmount());
|
||||
|
||||
//Add 3.2 to lot 2
|
||||
$this->service->add($this->partLot2, 3.2, "Test");
|
||||
$this->assertEquals(5, $this->partLot2->getAmount());
|
||||
$this->assertSame(5, $this->partLot2->getAmount());
|
||||
|
||||
//Add 1.5 to lot 3
|
||||
$this->service->add($this->partLot3, 1.5, "Test");
|
||||
$this->assertEquals(2, $this->partLot3->getAmount());
|
||||
$this->assertSame(2, $this->partLot3->getAmount());
|
||||
|
||||
}
|
||||
|
||||
|
@ -133,23 +133,23 @@ class PartLotWithdrawAddHelperTest extends WebTestCase
|
|||
{
|
||||
//Withdraw 5 from lot 1
|
||||
$this->service->withdraw($this->partLot1, 5, "Test");
|
||||
$this->assertEquals(5, $this->partLot1->getAmount());
|
||||
$this->assertSame(5, $this->partLot1->getAmount());
|
||||
|
||||
//Withdraw 2.2 from lot 2
|
||||
$this->service->withdraw($this->partLot2, 2.2, "Test");
|
||||
$this->assertEquals(0, $this->partLot2->getAmount());
|
||||
$this->assertSame(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->assertEquals(5, $this->partLot1->getAmount());
|
||||
$this->assertEquals(7, $this->partLot2->getAmount());
|
||||
$this->assertSame(5, $this->partLot1->getAmount());
|
||||
$this->assertSame(7, $this->partLot2->getAmount());
|
||||
|
||||
//Move 2.2 from lot 2 to lot 3
|
||||
$this->service->move($this->partLot2, $this->partLot3, 2.2, "Test");
|
||||
$this->assertEquals(5, $this->partLot2->getAmount());
|
||||
$this->assertEquals(2, $this->partLot3->getAmount());
|
||||
$this->assertSame(5, $this->partLot2->getAmount());
|
||||
$this->assertSame(2, $this->partLot3->getAmount());
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue