Applied rector to test files

This commit is contained in:
Jan Böhmer 2023-06-11 14:18:53 +02:00
parent 7ee01d9a05
commit 98dc553938
46 changed files with 42 additions and 102 deletions

View file

@ -40,8 +40,6 @@ class AttachmentPathResolverTest extends WebTestCase
public function setUp(): void
{
parent::setUp();
//Get a service instance.
self::bootKernel();
@ -161,7 +159,6 @@ class AttachmentPathResolverTest extends WebTestCase
/**
* @dataProvider germanFootprintPathdDataProvider
* @return void
*/
public function testConversionOfGermanFootprintPaths(string $expected, string $input): void
{

View file

@ -41,8 +41,6 @@ class ElementTypeNameGeneratorTest extends WebTestCase
protected function setUp(): void
{
parent::setUp();
//Get an service instance.
$this->service = self::getContainer()->get(ElementTypeNameGenerator::class);
}

View file

@ -36,7 +36,7 @@ class AmountFormatterTest extends WebTestCase
protected function setUp(): void
{
parent::setUp(); // TODO: Change the autogenerated stub
// TODO: Change the autogenerated stub
//Get a service instance.
self::bootKernel();
@ -47,7 +47,7 @@ class AmountFormatterTest extends WebTestCase
{
$this->assertSame('2', $this->service->format(2.321));
$this->assertSame('1002', $this->service->format(1002.356));
$this->assertSame('1000454', $this->service->format(1000454.0));
$this->assertSame('1000454', $this->service->format(1_000_454.0));
$this->assertSame('0', $this->service->format(0.01));
$this->assertSame('0', $this->service->format(0));
}

View file

@ -36,8 +36,6 @@ class BOMImporterTest extends WebTestCase
protected function setUp(): void
{
parent::setUp();
//Get a service instance.
self::bootKernel();
$this->service = self::getContainer()->get(BOMImporter::class);

View file

@ -34,7 +34,6 @@ class EntityExporterTest extends WebTestCase
protected function setUp(): void
{
parent::setUp();
self::bootKernel();
$this->service = self::getContainer()->get(EntityExporter::class);
}

View file

@ -42,8 +42,6 @@ class EntityImporterTest extends WebTestCase
protected function setUp(): void
{
parent::setUp();
//Get a service instance.
self::bootKernel();
$this->service = self::getContainer()->get(EntityImporter::class);

View file

@ -49,10 +49,7 @@ use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
class BarcodeContentGeneratorTest extends KernelTestCase
{
/**
* @var BarcodeContentGenerator
*/
private $service;
private ?object $service = null;
protected function setUp(): void
{

View file

@ -75,14 +75,14 @@ class BarcodeNormalizerTest extends WebTestCase
[['lot', 10], 'Lß000010'],
[['part', 123], 'P-000123'],
[['location', 123], 'S-000123'],
[['lot', 12345678], 'L-12345678'],
[['lot', 12_345_678], 'L-12345678'],
//Legacy storelocation format
[['location', 336], '$L00336'],
[['location', 12345678], '$L12345678'],
[['location', 12_345_678], '$L12345678'],
//Legacy Part format
[['part', 123], '0000123'],
[['part', 123], '00001236'],
[['part', 1234567], '12345678'],
[['part', 1_234_567], '12345678'],
];
}

View file

@ -47,10 +47,7 @@ use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
class BarcodeRedirectorTest extends KernelTestCase
{
/**
* @var BarcodeRedirector
*/
private $service;
private ?object $service = null;
protected function setUp(): void
{
@ -81,7 +78,7 @@ class BarcodeRedirectorTest extends KernelTestCase
{
$this->expectException(EntityNotFoundException::class);
//If we encounter an invalid lot, we must throw an exception
$this->service->getRedirectURL('lot', 12345678);
$this->service->getRedirectURL('lot', 12_345_678);
}
public function testInvalidType(): void

View file

@ -60,8 +60,6 @@ class LabelTextReplacerTest extends WebTestCase
protected function setUp(): void
{
parent::setUp();
//Get a service instance.
self::bootKernel();
$this->service = self::getContainer()->get(LabelTextReplacer::class);

View file

@ -51,10 +51,7 @@ use Twig\Sandbox\SecurityError;
class SandboxedTwigProviderTest extends WebTestCase
{
/**
* @var SandboxedTwigProvider
*/
private $service;
private ?object $service = null;
protected function setUp(): void
{

View file

@ -53,7 +53,7 @@ class EventCommentHelperTest extends WebTestCase
protected function setUp(): void
{
parent::setUp(); // TODO: Change the autogenerated stub
// TODO: Change the autogenerated stub
//Get a service instance.
self::bootKernel();

View file

@ -56,7 +56,7 @@ class EventLoggerTest extends WebTestCase
protected function setUp(): void
{
parent::setUp(); // TODO: Change the autogenerated stub
// TODO: Change the autogenerated stub
//Get a service instance.
self::bootKernel();

View file

@ -34,7 +34,7 @@ class FAIconGeneratorTest extends WebTestCase
protected function setUp(): void
{
parent::setUp(); // TODO: Change the autogenerated stub
// TODO: Change the autogenerated stub
//Get a service instance.
self::bootKernel();

View file

@ -51,7 +51,6 @@ class ParameterExtractorTest extends WebTestCase
protected function setUp(): void
{
parent::setUp();
//Get a service instance.
self::bootKernel();
$this->service = self::getContainer()->get(ParameterExtractor::class);

View file

@ -46,7 +46,6 @@ class PartLotWithdrawAddHelperTest extends WebTestCase
protected function setUp(): void
{
parent::setUp();
//Get a service instance.
self::bootKernel();
$this->service = self::getContainer()->get(PartLotWithdrawAddHelper::class);

View file

@ -38,7 +38,6 @@ class PricedetailHelperTest extends WebTestCase
protected function setUp(): void
{
parent::setUp();
//Get a service instance.
self::bootKernel();
$this->service = self::getContainer()->get(PricedetailHelper::class);

View file

@ -34,7 +34,6 @@ class ProjectBuildHelperTest extends WebTestCase
protected function setUp(): void
{
parent::setUp();
self::bootKernel();
$this->service = self::getContainer()->get(ProjectBuildHelper::class);
}

View file

@ -31,7 +31,6 @@ class ProjectBuildPartHelperTest extends WebTestCase
protected function setUp(): void
{
parent::setUp();
self::bootKernel();
$this->service = self::getContainer()->get(ProjectBuildPartHelper::class);
}

View file

@ -42,7 +42,7 @@ class TreeViewGeneratorTest extends WebTestCase
protected function setUp(): void
{
parent::setUp(); // TODO: Change the autogenerated stub
// TODO: Change the autogenerated stub
//Get a service instance.
self::bootKernel();

View file

@ -43,7 +43,7 @@ class PermissionManagerTest extends WebTestCase
protected function setUp(): void
{
parent::setUp(); // TODO: Change the autogenerated stub
// TODO: Change the autogenerated stub
//Get a service instance.
self::bootKernel();

View file

@ -27,11 +27,8 @@ use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
class TestPermissionHolder implements HasPermissionsInterface
{
private PermissionData $perm_data;
public function __construct(PermissionData $perm_data)
public function __construct(private readonly PermissionData $perm_data)
{
$this->perm_data = $perm_data;
}
public function getPermissions(): PermissionData
@ -49,7 +46,6 @@ class PermissionSchemaUpdaterTest extends WebTestCase
public function setUp(): void
{
parent::setUp();
self::bootKernel();
$this->service = self::getContainer()->get(PermissionSchemaUpdater::class);