mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-12-25 12:29:31 +00:00
Fixed coding style.
This commit is contained in:
parent
e9493e52ec
commit
f5d685dfd4
71 changed files with 619 additions and 531 deletions
|
|
@ -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,29 +24,25 @@
|
|||
namespace App\Tests\Services\LabelSystem\PlaceholderProviders;
|
||||
|
||||
use App\Entity\Base\AbstractDBElement;
|
||||
use App\Entity\Parts\Part;
|
||||
use App\Services\LabelSystem\PlaceholderProviders\AbstractDBElementProvider;
|
||||
use App\Services\LabelSystem\PlaceholderProviders\GlobalProviders;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
|
||||
|
||||
class AbstractElementProviderTest extends WebTestCase
|
||||
{
|
||||
/** @var AbstractDBElementProvider */
|
||||
/**
|
||||
* @var AbstractDBElementProvider
|
||||
*/
|
||||
protected $service;
|
||||
|
||||
protected $target;
|
||||
|
||||
public function setUp(): void
|
||||
protected function setUp(): void
|
||||
{
|
||||
self::bootKernel();
|
||||
$this->service = self::$container->get(AbstractDBElementProvider::class);
|
||||
$this->target = new class extends AbstractDBElement {
|
||||
$this->target = new class() extends AbstractDBElement {
|
||||
protected $id = 123;
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function getIDString(): string
|
||||
{
|
||||
return 'ignore';
|
||||
|
|
|
|||
|
|
@ -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,17 +25,18 @@ namespace App\Tests\Services\LabelSystem\PlaceholderProviders;
|
|||
|
||||
use App\Entity\Parts\Part;
|
||||
use App\Services\LabelSystem\PlaceholderProviders\GlobalProviders;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
|
||||
|
||||
class GlobalProvidersTest extends WebTestCase
|
||||
{
|
||||
/** @var GlobalProviders */
|
||||
/**
|
||||
* @var GlobalProviders
|
||||
*/
|
||||
protected $service;
|
||||
|
||||
protected $target;
|
||||
|
||||
public function setUp(): void
|
||||
protected function setUp(): void
|
||||
{
|
||||
self::bootKernel();
|
||||
$this->service = self::$container->get(GlobalProviders::class);
|
||||
|
|
|
|||
|
|
@ -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,28 +24,23 @@
|
|||
namespace App\Tests\Services\LabelSystem\PlaceholderProviders;
|
||||
|
||||
use App\Entity\Contracts\NamedElementInterface;
|
||||
use App\Entity\Parts\Part;
|
||||
use App\Services\LabelSystem\PlaceholderProviders\GlobalProviders;
|
||||
use App\Services\LabelSystem\PlaceholderProviders\NamedElementProvider;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
|
||||
|
||||
class NamedElementProviderTest extends WebTestCase
|
||||
{
|
||||
/** @var NamedElementProvider */
|
||||
/**
|
||||
* @var NamedElementProvider
|
||||
*/
|
||||
protected $service;
|
||||
|
||||
protected $target;
|
||||
|
||||
public function setUp(): void
|
||||
protected function setUp(): void
|
||||
{
|
||||
self::bootKernel();
|
||||
$this->service = self::$container->get(NamedElementProvider::class);
|
||||
$this->target = new class implements NamedElementInterface {
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
$this->target = new class() implements NamedElementInterface {
|
||||
public function getName(): string
|
||||
{
|
||||
return 'This is my Name';
|
||||
|
|
@ -53,7 +51,7 @@ class NamedElementProviderTest extends WebTestCase
|
|||
public function dataProvider(): array
|
||||
{
|
||||
return [
|
||||
['This is my Name', '[[NAME]]']
|
||||
['This is my Name', '[[NAME]]'],
|
||||
];
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,7 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* This file is part of Part-DB (https://github.com/Part-DB/Part-DB-symfony).
|
||||
*
|
||||
|
|
@ -20,22 +23,22 @@
|
|||
|
||||
namespace App\Tests\Services\LabelSystem\PlaceholderProviders;
|
||||
|
||||
use App\Entity\Contracts\NamedElementInterface;
|
||||
use App\Entity\Parts\Part;
|
||||
use App\Entity\Parts\PartLot;
|
||||
use App\Entity\Parts\Storelocation;
|
||||
use App\Services\LabelSystem\PlaceholderProviders\NamedElementProvider;
|
||||
use App\Services\LabelSystem\PlaceholderProviders\PartLotProvider;
|
||||
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
|
||||
|
||||
class PartLotProviderTest extends WebTestCase
|
||||
{
|
||||
/** @var PartLotProvider */
|
||||
/**
|
||||
* @var PartLotProvider
|
||||
*/
|
||||
protected $service;
|
||||
|
||||
protected $target;
|
||||
|
||||
public function setUp(): void
|
||||
protected function setUp(): void
|
||||
{
|
||||
self::bootKernel();
|
||||
\Locale::setDefault('en');
|
||||
|
|
|
|||
|
|
@ -1,4 +1,7 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* This file is part of Part-DB (https://github.com/Part-DB/Part-DB-symfony).
|
||||
*
|
||||
|
|
@ -20,14 +23,10 @@
|
|||
|
||||
namespace App\Tests\Services\LabelSystem\PlaceholderProviders;
|
||||
|
||||
use App\Entity\Contracts\TimeStampableInterface;
|
||||
use App\Entity\Parts\Category;
|
||||
use App\Entity\Parts\Footprint;
|
||||
use App\Entity\Parts\Manufacturer;
|
||||
use App\Entity\Parts\Part;
|
||||
use App\Services\LabelSystem\PlaceholderProviders\GlobalProviders;
|
||||
use App\Services\LabelSystem\PlaceholderProviders\PartProvider;
|
||||
use DateTime;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
|
||||
|
||||
|
|
@ -36,15 +35,19 @@ use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
|
|||
*/
|
||||
class PartProviderTest extends WebTestCase
|
||||
{
|
||||
/** @var PartProvider */
|
||||
/**
|
||||
* @var PartProvider
|
||||
*/
|
||||
protected $service;
|
||||
|
||||
protected $target;
|
||||
|
||||
/** @var \Doctrine\ORM\EntityManager */
|
||||
/**
|
||||
* @var \Doctrine\ORM\EntityManager
|
||||
*/
|
||||
protected $em;
|
||||
|
||||
public function setUp(): void
|
||||
protected function setUp(): void
|
||||
{
|
||||
self::bootKernel();
|
||||
$this->service = self::$container->get(PartProvider::class);
|
||||
|
|
|
|||
|
|
@ -1,4 +1,7 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* This file is part of Part-DB (https://github.com/Part-DB/Part-DB-symfony).
|
||||
*
|
||||
|
|
@ -28,29 +31,24 @@ use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
|
|||
|
||||
class TimestampableElementProviderTest extends WebTestCase
|
||||
{
|
||||
/** @var GlobalProviders */
|
||||
/**
|
||||
* @var GlobalProviders
|
||||
*/
|
||||
protected $service;
|
||||
|
||||
protected $target;
|
||||
|
||||
public function setUp(): void
|
||||
protected function setUp(): void
|
||||
{
|
||||
self::bootKernel();
|
||||
\Locale::setDefault('en');
|
||||
$this->service = self::$container->get(TimestampableElementProvider::class);
|
||||
$this->target = new class implements TimeStampableInterface {
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
$this->target = new class() implements TimeStampableInterface {
|
||||
public function getLastModified(): ?DateTime
|
||||
{
|
||||
return new \DateTime('2000-01-01');
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function getAddedDate(): ?DateTime
|
||||
{
|
||||
return new \DateTime('2000-01-01');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue