Improved code style of tests

This commit is contained in:
Jan Böhmer 2023-06-11 15:02:59 +02:00
parent 5629215ce4
commit 684334ba22
73 changed files with 196 additions and 38 deletions

View file

@ -48,6 +48,9 @@ use App\Services\LabelSystem\Barcodes\BarcodeContentGenerator;
use Com\Tecnick\Barcode\Barcode;
use InvalidArgumentException;
/**
* @see \App\Tests\Services\LabelSystem\BarcodeGeneratorTest
*/
final class BarcodeGenerator
{
public function __construct(private readonly BarcodeContentGenerator $barcodeContentGenerator)

View file

@ -48,6 +48,9 @@ use App\Entity\Parts\Storelocation;
use InvalidArgumentException;
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
/**
* @see \App\Tests\Services\LabelSystem\Barcodes\BarcodeContentGeneratorTest
*/
final class BarcodeContentGenerator
{
public const PREFIX_MAP = [

View file

@ -43,6 +43,9 @@ namespace App\Services\LabelSystem\Barcodes;
use InvalidArgumentException;
/**
* @see \App\Tests\Services\LabelSystem\Barcodes\BarcodeNormalizerTest
*/
final class BarcodeNormalizer
{
private const PREFIX_TYPE_MAP = [

View file

@ -47,6 +47,9 @@ use Doctrine\ORM\EntityNotFoundException;
use InvalidArgumentException;
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
/**
* @see \App\Tests\Services\LabelSystem\Barcodes\BarcodeRedirectorTest
*/
final class BarcodeRedirector
{
public function __construct(private readonly UrlGeneratorInterface $urlGenerator, private readonly EntityManagerInterface $em)

View file

@ -48,6 +48,9 @@ use App\Entity\Parts\Storelocation;
use Dompdf\Dompdf;
use InvalidArgumentException;
/**
* @see \App\Tests\Services\LabelSystem\LabelGeneratorTest
*/
final class LabelGenerator
{
public const CLASS_SUPPORT_MAPPING = [

View file

@ -46,6 +46,7 @@ use App\Services\LabelSystem\PlaceholderProviders\PlaceholderProviderInterface;
/**
* This service replaces the Placeholders of the user provided lines with the proper informations.
* It uses the PlaceholderProviders provided by PlaceholderProviderInterface classes.
* @see \App\Tests\Services\LabelSystem\LabelTextReplacerTest
*/
final class LabelTextReplacer
{

View file

@ -50,6 +50,7 @@ use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
/**
* Provides Placeholders for infos about global infos like Installation name or datetimes.
* @see \App\Tests\Services\LabelSystem\PlaceholderProviders\GlobalProvidersTest
*/
final class GlobalProviders implements PlaceholderProviderInterface
{

View file

@ -43,6 +43,9 @@ namespace App\Services\LabelSystem\PlaceholderProviders;
use App\Entity\Contracts\NamedElementInterface;
/**
* @see \App\Tests\Services\LabelSystem\PlaceholderProviders\NamedElementProviderTest
*/
final class NamedElementProvider implements PlaceholderProviderInterface
{
public function replace(string $placeholder, object $label_target, array $options = []): ?string

View file

@ -49,6 +49,9 @@ use App\Services\LabelSystem\LabelTextReplacer;
use IntlDateFormatter;
use Locale;
/**
* @see \App\Tests\Services\LabelSystem\PlaceholderProviders\PartLotProviderTest
*/
final class PartLotProvider implements PlaceholderProviderInterface
{
public function __construct(private readonly LabelTextReplacer $labelTextReplacer, private readonly AmountFormatter $amountFormatter)

View file

@ -49,6 +49,9 @@ use App\Services\Formatters\SIFormatter;
use Parsedown;
use Symfony\Contracts\Translation\TranslatorInterface;
/**
* @see \App\Tests\Services\LabelSystem\PlaceholderProviders\PartProviderTest
*/
final class PartProvider implements PlaceholderProviderInterface
{
public function __construct(private readonly SIFormatter $siFormatter, private readonly TranslatorInterface $translator)

View file

@ -46,6 +46,9 @@ use DateTime;
use IntlDateFormatter;
use Locale;
/**
* @see \App\Tests\Services\LabelSystem\PlaceholderProviders\TimestampableElementProviderTest
*/
final class TimestampableElementProvider implements PlaceholderProviderInterface
{
public function replace(string $placeholder, object $label_target, array $options = []): ?string

View file

@ -68,6 +68,9 @@ use Twig\Extra\Intl\IntlExtension;
use Twig\Loader\ArrayLoader;
use Twig\Sandbox\SecurityPolicyInterface;
/**
* @see \App\Tests\Services\LabelSystem\SandboxedTwigProviderTest
*/
final class SandboxedTwigProvider
{
private const ALLOWED_TAGS = ['apply', 'autoescape', 'do', 'for', 'if', 'set', 'verbatim', 'with'];