Fixed some inspection issues

This commit is contained in:
Jan Böhmer 2022-12-18 19:45:04 +01:00
parent c6f1758a18
commit 8ae4e9fe05
39 changed files with 46 additions and 56 deletions

View file

@ -22,8 +22,8 @@ declare(strict_types=1);
namespace App\Tests\Controller;
use App\Entity\UserSystem\User;
use Doctrine\ORM\EntityManagerInterface;
use Proxies\__CG__\App\Entity\UserSystem\User;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
/**
@ -44,7 +44,7 @@ class RedirectControllerTest extends WebTestCase
]);
$this->client->disableReboot();
$this->client->catchExceptions(false);
$this->em = self::$container->get(EntityManagerInterface::class);
$this->em = self::getContainer()->get(EntityManagerInterface::class);
$this->userRepo = $this->em->getRepository(User::class);
}

View file

@ -40,7 +40,7 @@ class TreeViewNodeTest extends TestCase
{
$sub_nodes = [];
$sub_nodes[] = new TreeViewNode('Subnode 1');
$sub_sub_nodes[] = [];
$sub_sub_nodes = [];
$sub_sub_nodes[] = new TreeViewNode('Sub Subnode 1');
$sub_sub_nodes[] = new TreeViewNode('Sub Subnode 2');
$sub_nodes[] = new TreeViewNode('Subnode 2');

View file

@ -35,7 +35,7 @@ class AttachmentURLGeneratorTest extends WebTestCase
{
//Get an service instance.
self::bootKernel();
self::$service = self::$container->get(AttachmentURLGenerator::class);
self::$service = self::getContainer()->get(AttachmentURLGenerator::class);
}
public function dataProvider(): array

View file

@ -40,7 +40,7 @@ class BuiltinAttachmentsFinderTest extends WebTestCase
{
//Get an service instance.
self::bootKernel();
self::$service = self::$container->get(BuiltinAttachmentsFinder::class);
self::$service = self::getContainer()->get(BuiltinAttachmentsFinder::class);
}
public function dataProvider(): array

View file

@ -32,7 +32,7 @@ class FileTypeFilterToolsTest extends WebTestCase
public static function setUpBeforeClass(): void
{
self::bootKernel();
self::$service = self::$container->get(FileTypeFilterTools::class);
self::$service = self::getContainer()->get(FileTypeFilterTools::class);
}
public function validateDataProvider(): array

View file

@ -40,7 +40,7 @@ class AmountFormatterTest extends WebTestCase
//Get an service instance.
self::bootKernel();
$this->service = self::$container->get(AmountFormatter::class);
$this->service = self::getContainer()->get(AmountFormatter::class);
}
public function testFormatWithoutUnit(): void

View file

@ -43,7 +43,7 @@ class EntityImporterTest extends WebTestCase
//Get an service instance.
self::bootKernel();
$this->service = self::$container->get(EntityImporter::class);
$this->service = self::getContainer()->get(EntityImporter::class);
}
public function testMassCreationResults(): void

View file

@ -57,7 +57,7 @@ class BarcodeContentGeneratorTest extends KernelTestCase
protected function setUp(): void
{
self::bootKernel();
$this->service = self::$container->get(BarcodeContentGenerator::class);
$this->service = self::getContainer()->get(BarcodeContentGenerator::class);
}
public function Barcode1DDataProvider(): array

View file

@ -54,7 +54,7 @@ class BarcodeNormalizerTest extends WebTestCase
protected function setUp(): void
{
self::bootKernel();
$this->service = self::$container->get(BarcodeNormalizer::class);
$this->service = self::getContainer()->get(BarcodeNormalizer::class);
}
public function dataProvider(): array

View file

@ -55,7 +55,7 @@ class BarcodeRedirectorTest extends KernelTestCase
protected function setUp(): void
{
self::bootKernel();
$this->service = self::$container->get(BarcodeRedirector::class);
$this->service = self::getContainer()->get(BarcodeRedirector::class);
}
public function urlDataProvider(): array

View file

@ -59,7 +59,7 @@ class LabelGeneratorTest extends WebTestCase
protected function setUp(): void
{
self::bootKernel();
$this->service = self::$container->get(LabelGenerator::class);
$this->service = self::getContainer()->get(LabelGenerator::class);
}
public function supportsDataProvider(): array

View file

@ -64,7 +64,7 @@ class LabelTextReplacerTest extends WebTestCase
//Get an service instance.
self::bootKernel();
$this->service = self::$container->get(LabelTextReplacer::class);
$this->service = self::getContainer()->get(LabelTextReplacer::class);
$this->target = new Part();
$this->target->setName('Part 1');

View file

@ -57,7 +57,7 @@ class AbstractElementProviderTest extends WebTestCase
protected function setUp(): void
{
self::bootKernel();
$this->service = self::$container->get(AbstractDBElementProvider::class);
$this->service = self::getContainer()->get(AbstractDBElementProvider::class);
$this->target = new class() extends AbstractDBElement {
protected ?int $id = 123;
};

View file

@ -57,7 +57,7 @@ class GlobalProvidersTest extends WebTestCase
protected function setUp(): void
{
self::bootKernel();
$this->service = self::$container->get(GlobalProviders::class);
$this->service = self::getContainer()->get(GlobalProviders::class);
$this->target = new Part();
}

View file

@ -57,7 +57,7 @@ class NamedElementProviderTest extends WebTestCase
protected function setUp(): void
{
self::bootKernel();
$this->service = self::$container->get(NamedElementProvider::class);
$this->service = self::getContainer()->get(NamedElementProvider::class);
$this->target = new class() implements NamedElementInterface {
public function getName(): string
{

View file

@ -68,9 +68,9 @@ class PartProviderTest extends WebTestCase
protected function setUp(): void
{
self::bootKernel();
$this->service = self::$container->get(PartProvider::class);
$this->service = self::getContainer()->get(PartProvider::class);
$this->target = new Part();
$this->em = self::$container->get(EntityManagerInterface::class);
$this->em = self::getContainer()->get(EntityManagerInterface::class);
$this->target->setCategory($this->em->find(Category::class, 6));
$this->target->setFootprint($this->em->find(Footprint::class, 6));

View file

@ -60,7 +60,7 @@ class TimestampableElementProviderTest extends WebTestCase
{
self::bootKernel();
\Locale::setDefault('en');
$this->service = self::$container->get(TimestampableElementProvider::class);
$this->service = self::getContainer()->get(TimestampableElementProvider::class);
$this->target = new class() implements TimeStampableInterface {
public function getLastModified(): ?DateTime
{

View file

@ -57,7 +57,7 @@ class EventCommentHelperTest extends WebTestCase
//Get an service instance.
self::bootKernel();
$this->service = self::$container->get(EventCommentHelper::class);
$this->service = self::getContainer()->get(EventCommentHelper::class);
}
public function testInitialState(): void

View file

@ -60,7 +60,7 @@ class EventLoggerTest extends WebTestCase
//Get an service instance.
self::bootKernel();
$this->service = self::$container->get(EventLogger::class);
$this->service = self::getContainer()->get(EventLogger::class);
}
public function testShouldBeAdded(): void

View file

@ -29,7 +29,7 @@ use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
class FAIconGeneratorTest extends WebTestCase
{
/**
* @var AmountFormatter
* @var FAIconGenerator
*/
protected $service;
@ -39,7 +39,7 @@ class FAIconGeneratorTest extends WebTestCase
//Get an service instance.
self::bootKernel();
$this->service = self::$container->get(FAIconGenerator::class);
$this->service = self::getContainer()->get(FAIconGenerator::class);
}
public function fileExtensionDataProvider(): array

View file

@ -54,7 +54,7 @@ class RangeParserTest extends WebTestCase
protected function setUp(): void
{
self::bootKernel();
$this->service = self::$container->get(RangeParser::class);
$this->service = self::getContainer()->get(RangeParser::class);
}
public function dataProvider(): array

View file

@ -54,7 +54,7 @@ class ParameterExtractorTest extends WebTestCase
parent::setUp();
//Get an service instance.
self::bootKernel();
$this->service = self::$container->get(ParameterExtractor::class);
$this->service = self::getContainer()->get(ParameterExtractor::class);
}
public function emptyDataProvider(): array

View file

@ -41,7 +41,7 @@ class PricedetailHelperTest extends WebTestCase
parent::setUp();
//Get an service instance.
self::bootKernel();
$this->service = self::$container->get(PricedetailHelper::class);
$this->service = self::getContainer()->get(PricedetailHelper::class);
}
public function maxDiscountAmountDataProvider(): ?\Generator

View file

@ -41,8 +41,8 @@ class NodesListBuilderTest extends WebTestCase
protected function setUp(): void
{
self::bootKernel();
$this->service = self::$container->get(NodesListBuilder::class);
$this->em = self::$container->get(EntityManagerInterface::class);
$this->service = self::getContainer()->get(NodesListBuilder::class);
$this->em = self::getContainer()->get(EntityManagerInterface::class);
}
/**

View file

@ -46,8 +46,8 @@ class TreeViewGeneratorTest extends WebTestCase
//Get an service instance.
self::bootKernel();
$this->service = self::$container->get(TreeViewGenerator::class);
$this->em = self::$container->get(EntityManagerInterface::class);
$this->service = self::getContainer()->get(TreeViewGenerator::class);
$this->em = self::getContainer()->get(EntityManagerInterface::class);
}
public function testGetGenericTree(): void

View file

@ -36,7 +36,7 @@ class BackupCodeManagerTest extends WebTestCase
protected function setUp(): void
{
self::bootKernel();
$this->service = self::$container->get(BackupCodeManager::class);
$this->service = self::getContainer()->get(BackupCodeManager::class);
}
public function testRegenerateBackupCodes(): void