Applied rectors phpunit 9 migrations to tests

This commit is contained in:
Jan Böhmer 2023-06-11 15:15:55 +02:00
parent 684334ba22
commit fcbb1849ec
22 changed files with 162 additions and 187 deletions

View file

@ -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));
}
}