Fixed coding style.

This commit is contained in:
Jan Böhmer 2020-05-10 21:39:31 +02:00
parent e9493e52ec
commit f5d685dfd4
71 changed files with 619 additions and 531 deletions

View file

@ -1,4 +1,7 @@
<?php
declare(strict_types=1);
/**
* This file is part of Part-DB (https://github.com/Part-DB/Part-DB-symfony).
*
@ -24,21 +27,21 @@ use App\Entity\Parts\Part;
use App\Entity\Parts\PartLot;
use App\Entity\Parts\Storelocation;
use App\Services\LabelSystem\Barcodes\BarcodeContentGenerator;
use PHPUnit\Framework\TestCase;
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
class BarcodeContentGeneratorTest extends KernelTestCase
{
/** @var BarcodeContentGenerator */
/**
* @var BarcodeContentGenerator
*/
private $service;
public function setUp(): void
protected function setUp(): void
{
self::bootKernel();
$this->service = self::$container->get(BarcodeContentGenerator::class);
}
public function Barcode1DDataProvider(): array
{
return [
@ -53,7 +56,7 @@ class BarcodeContentGeneratorTest extends KernelTestCase
return [
['/scan/part/0', Part::class],
['/scan/lot/0', PartLot::class],
['/scan/location/0', Storelocation::class]
['/scan/location/0', Storelocation::class],
];
}

View file

@ -1,4 +1,7 @@
<?php
declare(strict_types=1);
/**
* This file is part of Part-DB (https://github.com/Part-DB/Part-DB-symfony).
*
@ -21,16 +24,16 @@
namespace App\Tests\Services\LabelSystem\Barcodes;
use App\Services\LabelSystem\Barcodes\BarcodeNormalizer;
use PHPUnit\Framework\TestCase;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
class BarcodeNormalizerTest extends WebTestCase
{
/** @var BarcodeNormalizer */
/**
* @var BarcodeNormalizer
*/
protected $service;
public function setUp(): void
protected function setUp(): void
{
self::bootKernel();
$this->service = self::$container->get(BarcodeNormalizer::class);
@ -80,7 +83,7 @@ class BarcodeNormalizerTest extends WebTestCase
/**
* @dataProvider dataProvider
*/
public function testNormalizeBarcodeContent(array $expected, string $input)
public function testNormalizeBarcodeContent(array $expected, string $input): void
{
$this->assertSame($expected, $this->service->normalizeBarcodeContent($input));
}
@ -88,7 +91,7 @@ class BarcodeNormalizerTest extends WebTestCase
/**
* @dataProvider invalidDataProvider
*/
public function testInvalidFormats(string $input)
public function testInvalidFormats(string $input): void
{
$this->expectException(\InvalidArgumentException::class);
$this->service->normalizeBarcodeContent($input);

View file

@ -1,4 +1,7 @@
<?php
declare(strict_types=1);
/**
* This file is part of Part-DB (https://github.com/Part-DB/Part-DB-symfony).
*
@ -22,15 +25,16 @@ namespace App\Tests\Services\LabelSystem\Barcodes;
use App\Services\LabelSystem\Barcodes\BarcodeRedirector;
use Doctrine\ORM\EntityNotFoundException;
use PHPUnit\Framework\TestCase;
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
class BarcodeRedirectorTest extends KernelTestCase
{
/** @var BarcodeRedirector */
/**
* @var BarcodeRedirector
*/
private $service;
public function setUp(): void
protected function setUp(): void
{
self::bootKernel();
$this->service = self::$container->get(BarcodeRedirector::class);
@ -42,7 +46,7 @@ class BarcodeRedirectorTest extends KernelTestCase
['part', '/en/part/1'],
//Part lot redirects to Part info page (Part lot 1 is associated with part 3
['lot', '/en/part/3'],
['location', '/en/store_location/1/parts']
['location', '/en/store_location/1/parts'],
];
}