Fixed some return type deprecation messages

This commit is contained in:
Jan Böhmer 2023-04-15 19:33:39 +02:00
parent 558440168d
commit 1cee1abe00
37 changed files with 70 additions and 70 deletions

View file

@ -140,7 +140,7 @@ class AttachmentPathResolverTest extends WebTestCase
$this->assertSame($expected, $this->service->realPathToPlaceholder($param, $old_method));
}
public function germanFootprintPathdDataProvider()
public function germanFootprintPathdDataProvider(): ?\Generator
{
self::bootKernel();
$this->projectDir_orig = realpath(self::$kernel->getProjectDir());

View file

@ -25,7 +25,7 @@ use PHPUnit\Framework\TestCase;
class EventCommentNeededHelperTest extends TestCase
{
public function testIsCommentNeeded()
public function testIsCommentNeeded(): void
{
$service = new EventCommentNeededHelper(['part_edit', 'part_create']);
$this->assertTrue($service->isCommentNeeded('part_edit'));
@ -34,7 +34,7 @@ class EventCommentNeededHelperTest extends TestCase
$this->assertFalse($service->isCommentNeeded('part_stock_operation'));
}
public function testIsCommentNeededInvalidTypeException()
public function testIsCommentNeededInvalidTypeException(): void
{
$service = new EventCommentNeededHelper(['part_edit', 'part_create']);
$this->expectException(\InvalidArgumentException::class);

View file

@ -26,7 +26,7 @@ use PHPUnit\Framework\TestCase;
class MySQLDumpXMLConverterTest extends TestCase
{
public function testConvertMySQLDumpXMLDataToArrayStructure()
public function testConvertMySQLDumpXMLDataToArrayStructure(): void
{
$service = new MySQLDumpXMLConverter();

View file

@ -89,7 +89,7 @@ class PartLotWithdrawAddHelperTest extends WebTestCase
$this->lotWithUnknownInstock->setStorageLocation($this->storageLocation);
}
public function testCanWithdraw()
public function testCanWithdraw(): void
{
//Normal lots should be withdrawable
$this->assertTrue($this->service->canWithdraw($this->partLot1));
@ -103,7 +103,7 @@ class PartLotWithdrawAddHelperTest extends WebTestCase
$this->assertFalse($this->service->canWithdraw($this->lotWithUnknownInstock));
}
public function testCanAdd()
public function testCanAdd(): void
{
//Normal lots should be addable
$this->assertTrue($this->service->canAdd($this->partLot1));
@ -116,7 +116,7 @@ class PartLotWithdrawAddHelperTest extends WebTestCase
$this->assertFalse($this->service->canAdd($this->lotWithUnknownInstock));
}
public function testAdd()
public function testAdd(): void
{
//Add 5 to lot 1
$this->service->add($this->partLot1, 5, "Test");
@ -132,7 +132,7 @@ class PartLotWithdrawAddHelperTest extends WebTestCase
}
public function testWithdraw()
public function testWithdraw(): void
{
//Withdraw 5 from lot 1
$this->service->withdraw($this->partLot1, 5, "Test");
@ -143,7 +143,7 @@ class PartLotWithdrawAddHelperTest extends WebTestCase
$this->assertEquals(0, $this->partLot2->getAmount());
}
public function testMove()
public function testMove(): void
{
//Move 5 from lot 1 to lot 2
$this->service->move($this->partLot1, $this->partLot2, 5, "Test");

View file

@ -39,7 +39,7 @@ class ProjectBuildHelperTest extends WebTestCase
$this->service = self::getContainer()->get(ProjectBuildHelper::class);
}
public function testGetMaximumBuildableCountForBOMEntryNonPartBomEntry()
public function testGetMaximumBuildableCountForBOMEntryNonPartBomEntry(): void
{
$bom_entry = new ProjectBOMEntry();
$bom_entry->setPart(null);
@ -50,7 +50,7 @@ class ProjectBuildHelperTest extends WebTestCase
$this->service->getMaximumBuildableCountForBOMEntry($bom_entry);
}
public function testGetMaximumBuildableCountForBOMEntry()
public function testGetMaximumBuildableCountForBOMEntry(): void
{
$project_bom_entry = new ProjectBOMEntry();
$project_bom_entry->setQuantity(10);
@ -74,7 +74,7 @@ class ProjectBuildHelperTest extends WebTestCase
$this->assertEquals(0, $this->service->getMaximumBuildableCountForBOMEntry($project_bom_entry));
}
public function testGetMaximumBuildableCount()
public function testGetMaximumBuildableCount(): void
{
$project = new Project();

View file

@ -56,7 +56,7 @@ class PermissionSchemaUpdaterTest extends WebTestCase
$this->service = self::$container->get(PermissionSchemaUpdater::class);
}
public function testIsSchemaUpdateNeeded()
public function testIsSchemaUpdateNeeded(): void
{
$perm_data = new PermissionData();
$perm_data->setSchemaVersion(0);
@ -70,7 +70,7 @@ class PermissionSchemaUpdaterTest extends WebTestCase
self::assertFalse($this->service->isSchemaUpdateNeeded($user));
}
public function testUpgradeSchema()
public function testUpgradeSchema(): void
{
$perm_data = new PermissionData();
$perm_data->setSchemaVersion(0);
@ -84,7 +84,7 @@ class PermissionSchemaUpdaterTest extends WebTestCase
self::assertFalse($this->service->upgradeSchema($user));
}
public function testUpgradeSchemaToVersion1()
public function testUpgradeSchemaToVersion1(): void
{
$perm_data = new PermissionData();
$perm_data->setSchemaVersion(0);
@ -98,7 +98,7 @@ class PermissionSchemaUpdaterTest extends WebTestCase
self::assertEquals(PermissionData::ALLOW, $user->getPermissions()->getPermissionValue('parts_stock', 'withdraw'));
}
public function testUpgradeSchemaToVersion2()
public function testUpgradeSchemaToVersion2(): void
{
$perm_data = new PermissionData();
$perm_data->setSchemaVersion(1);