mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-21 09:35:49 +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
|
@ -65,12 +65,12 @@ class ProjectBuildHelperTest extends WebTestCase
|
|||
$project_bom_entry->setPart($part);
|
||||
|
||||
//We have 125 parts in stock, so we can build 12 times the project (125 / 10 = 12.5)
|
||||
$this->assertEquals(12, $this->service->getMaximumBuildableCountForBOMEntry($project_bom_entry));
|
||||
$this->assertSame(12, $this->service->getMaximumBuildableCountForBOMEntry($project_bom_entry));
|
||||
|
||||
|
||||
$lot1->setAmount(0);
|
||||
//We have 5 parts in stock, so we can build 0 times the project (5 / 10 = 0.5)
|
||||
$this->assertEquals(0, $this->service->getMaximumBuildableCountForBOMEntry($project_bom_entry));
|
||||
$this->assertSame(0, $this->service->getMaximumBuildableCountForBOMEntry($project_bom_entry));
|
||||
}
|
||||
|
||||
public function testGetMaximumBuildableCount(): void
|
||||
|
@ -101,15 +101,15 @@ class ProjectBuildHelperTest extends WebTestCase
|
|||
$project->addBomEntry((new ProjectBOMEntry())->setName('Non part entry')->setQuantity(1));
|
||||
|
||||
//Restricted by the few parts in stock of part2
|
||||
$this->assertEquals(2, $this->service->getMaximumBuildableCount($project));
|
||||
$this->assertSame(2, $this->service->getMaximumBuildableCount($project));
|
||||
|
||||
$lot3->setAmount(1000);
|
||||
//Now the build count is restricted by the few parts in stock of part1
|
||||
$this->assertEquals(12, $this->service->getMaximumBuildableCount($project));
|
||||
$this->assertSame(12, $this->service->getMaximumBuildableCount($project));
|
||||
|
||||
$lot3->setAmount(0);
|
||||
//Now the build count must be 0, as we have no parts in stock
|
||||
$this->assertEquals(0, $this->service->getMaximumBuildableCount($project));
|
||||
$this->assertSame(0, $this->service->getMaximumBuildableCount($project));
|
||||
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue