mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-08-03 17:55:03 +02:00
Fixed code style.
This commit is contained in:
parent
1aed1d1d26
commit
9a7223a301
142 changed files with 534 additions and 716 deletions
|
@ -32,7 +32,7 @@ class AmountFormatterTest extends WebTestCase
|
|||
*/
|
||||
protected $service;
|
||||
|
||||
public function setUp() : void
|
||||
public function setUp(): void
|
||||
{
|
||||
parent::setUp(); // TODO: Change the autogenerated stub
|
||||
|
||||
|
|
|
@ -48,7 +48,7 @@ class AttachmentPathResolverTest extends WebTestCase
|
|||
self::$footprint_path = self::$projectDir.'/public/img/footprints';
|
||||
}
|
||||
|
||||
public static function setUpBeforeClass() : void
|
||||
public static function setUpBeforeClass(): void
|
||||
{
|
||||
parent::setUpBeforeClass();
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@ class AttachmentURLGeneratorTest extends WebTestCase
|
|||
|
||||
protected static $service;
|
||||
|
||||
public static function setUpBeforeClass() : void
|
||||
public static function setUpBeforeClass(): void
|
||||
{
|
||||
//Get an service instance.
|
||||
self::bootKernel();
|
||||
|
|
|
@ -34,7 +34,7 @@ class BuiltinAttachmentsFinderTest extends WebTestCase
|
|||
'%FOOTPRINTS_3D%/test.jpg', '%FOOTPRINTS_3D%/hallo.txt',
|
||||
];
|
||||
|
||||
public static function setUpBeforeClass() : void
|
||||
public static function setUpBeforeClass(): void
|
||||
{
|
||||
//Get an service instance.
|
||||
self::bootKernel();
|
||||
|
|
|
@ -28,7 +28,7 @@ class FileTypeFilterToolsTest extends WebTestCase
|
|||
{
|
||||
protected static $service;
|
||||
|
||||
public static function setUpBeforeClass() : void
|
||||
public static function setUpBeforeClass(): void
|
||||
{
|
||||
self::bootKernel();
|
||||
self::$service = self::$container->get(FileTypeFilterTools::class);
|
||||
|
|
|
@ -21,7 +21,6 @@
|
|||
|
||||
namespace App\Tests\Services;
|
||||
|
||||
|
||||
use App\Entity\Attachments\PartAttachment;
|
||||
use App\Entity\Base\DBElement;
|
||||
use App\Entity\Base\NamedDBElement;
|
||||
|
@ -30,7 +29,6 @@ use App\Entity\Parts\Part;
|
|||
use App\Exceptions\EntityNotSupportedException;
|
||||
use App\Services\AmountFormatter;
|
||||
use App\Services\ElementTypeNameGenerator;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
|
||||
|
||||
class ElementTypeNameGeneratorTest extends WebTestCase
|
||||
|
@ -40,7 +38,7 @@ class ElementTypeNameGeneratorTest extends WebTestCase
|
|||
*/
|
||||
protected $service;
|
||||
|
||||
public function setUp() : void
|
||||
public function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
|
@ -60,7 +58,7 @@ class ElementTypeNameGeneratorTest extends WebTestCase
|
|||
|
||||
//Test exception for unknpwn type
|
||||
$this->expectException(EntityNotSupportedException::class);
|
||||
$this->service->getLocalizedTypeLabel(new class extends DBElement {
|
||||
$this->service->getLocalizedTypeLabel(new class() extends DBElement {
|
||||
public function getIDString(): string
|
||||
{
|
||||
return 'Stub';
|
||||
|
@ -79,11 +77,11 @@ class ElementTypeNameGeneratorTest extends WebTestCase
|
|||
|
||||
//Test exception
|
||||
$this->expectException(EntityNotSupportedException::class);
|
||||
$this->service->getTypeNameCombination(new class extends NamedDBElement {
|
||||
$this->service->getTypeNameCombination(new class() extends NamedDBElement {
|
||||
public function getIDString(): string
|
||||
{
|
||||
return 'Stub';
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -21,10 +21,8 @@
|
|||
|
||||
namespace App\Tests\Services;
|
||||
|
||||
|
||||
use App\Entity\Attachments\AttachmentType;
|
||||
use App\Services\AmountFormatter;
|
||||
use App\Services\ElementTypeNameGenerator;
|
||||
use App\Services\EntityImporter;
|
||||
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
|
||||
|
||||
|
@ -38,7 +36,7 @@ class EntityImporterTest extends WebTestCase
|
|||
*/
|
||||
protected $service;
|
||||
|
||||
public function setUp() : void
|
||||
public function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
|
@ -84,4 +82,4 @@ class EntityImporterTest extends WebTestCase
|
|||
$this->assertCount(2, $errors);
|
||||
$this->assertEquals('Node 1', $errors[0]['entity']->getName());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -21,7 +21,6 @@
|
|||
|
||||
namespace App\Tests\Services;
|
||||
|
||||
|
||||
use App\Services\FAIconGenerator;
|
||||
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
|
||||
|
||||
|
@ -32,7 +31,7 @@ class FAIconGeneratorTest extends WebTestCase
|
|||
*/
|
||||
protected $service;
|
||||
|
||||
public function setUp() : void
|
||||
public function setUp(): void
|
||||
{
|
||||
parent::setUp(); // TODO: Change the autogenerated stub
|
||||
|
||||
|
@ -41,7 +40,7 @@ class FAIconGeneratorTest extends WebTestCase
|
|||
$this->service = self::$container->get(FAIconGenerator::class);
|
||||
}
|
||||
|
||||
public function fileExtensionDataProvider() : array
|
||||
public function fileExtensionDataProvider(): array
|
||||
{
|
||||
return [
|
||||
['pdf', 'fa-file-pdf'],
|
||||
|
@ -69,4 +68,4 @@ class FAIconGeneratorTest extends WebTestCase
|
|||
$this->assertEquals('<i class="far fa-file "></i>', $this->service->generateIconHTML('fa-file', 'far'));
|
||||
$this->assertEquals('<i class="far fa-file fa-2x"></i>', $this->service->generateIconHTML('fa-file', 'far', 'fa-2x'));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -38,7 +38,7 @@ class PermissionResolverTest extends WebTestCase
|
|||
protected $user_withoutGroup;
|
||||
protected $group;
|
||||
|
||||
public function setUp() : void
|
||||
public function setUp(): void
|
||||
{
|
||||
parent::setUp(); // TODO: Change the autogenerated stub
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@ class PricedetailHelperTest extends WebTestCase
|
|||
*/
|
||||
protected $service;
|
||||
|
||||
public function setUp() : void
|
||||
public function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
//Get an service instance.
|
||||
|
|
|
@ -31,7 +31,7 @@ class SIFormatterTest extends WebTestCase
|
|||
*/
|
||||
protected $service;
|
||||
|
||||
public function setUp() : void
|
||||
public function setUp(): void
|
||||
{
|
||||
//Get an service instance.
|
||||
self::bootKernel();
|
||||
|
|
|
@ -27,7 +27,7 @@ use PHPUnit\Framework\TestCase;
|
|||
class BackupCodeGeneratorTest extends TestCase
|
||||
{
|
||||
/**
|
||||
* Test if an exception is thrown if you are using a too high code length
|
||||
* Test if an exception is thrown if you are using a too high code length.
|
||||
*/
|
||||
public function testLengthUpperLimit()
|
||||
{
|
||||
|
@ -36,7 +36,7 @@ class BackupCodeGeneratorTest extends TestCase
|
|||
}
|
||||
|
||||
/**
|
||||
* Test if an exception is thrown if you are using a too high code length
|
||||
* Test if an exception is thrown if you are using a too high code length.
|
||||
*/
|
||||
public function testLengthLowerLimit()
|
||||
{
|
||||
|
@ -44,7 +44,6 @@ class BackupCodeGeneratorTest extends TestCase
|
|||
new BackupCodeGenerator(4, 10);
|
||||
}
|
||||
|
||||
|
||||
public function codeLengthDataProvider()
|
||||
{
|
||||
return [[6], [8], [10], [16]];
|
||||
|
|
|
@ -21,7 +21,6 @@
|
|||
|
||||
namespace App\Tests\Services\TFA;
|
||||
|
||||
use App\Entity\UserSystem\U2FKey;
|
||||
use App\Entity\UserSystem\User;
|
||||
use App\Services\TFA\BackupCodeManager;
|
||||
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
|
||||
|
@ -29,7 +28,7 @@ use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
|
|||
class BackupCodeManagerTest extends WebTestCase
|
||||
{
|
||||
/**
|
||||
* @var BackupCodeManager $service
|
||||
* @var BackupCodeManager
|
||||
*/
|
||||
protected $service;
|
||||
|
||||
|
|
|
@ -28,13 +28,11 @@ use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
|
|||
|
||||
/**
|
||||
* @Group DB
|
||||
* @package App\Tests\Services\Trees
|
||||
*/
|
||||
class NodesListBuilderTest extends WebTestCase
|
||||
{
|
||||
|
||||
/**
|
||||
* @var NodesListBuilder $service
|
||||
* @var NodesListBuilder
|
||||
*/
|
||||
protected $service;
|
||||
protected $em;
|
||||
|
@ -47,9 +45,9 @@ class NodesListBuilderTest extends WebTestCase
|
|||
}
|
||||
|
||||
/**
|
||||
* Test $repo->toNodesList() for null as parameter
|
||||
* Test $repo->toNodesList() for null as parameter.
|
||||
*/
|
||||
public function testTypeToNodesListtRoot() : void
|
||||
public function testTypeToNodesListtRoot(): void
|
||||
{
|
||||
//List all root nodes and their children
|
||||
$nodes = $this->service->typeToNodesList(AttachmentType::class);
|
||||
|
@ -65,7 +63,7 @@ class NodesListBuilderTest extends WebTestCase
|
|||
$this->assertEquals('Node 3', $nodes[6]->getName());
|
||||
}
|
||||
|
||||
public function testTypeToNodesListElement() : void
|
||||
public function testTypeToNodesListElement(): void
|
||||
{
|
||||
//List all nodes that are children to Node 1
|
||||
$node1 = $this->em->find(AttachmentType::class, 1);
|
||||
|
|
|
@ -24,10 +24,8 @@ namespace App\Tests\Services\Trees;
|
|||
use App\Entity\Attachments\AttachmentType;
|
||||
use App\Entity\Parts\Category;
|
||||
use App\Helpers\Trees\TreeViewNode;
|
||||
use App\Services\AmountFormatter;
|
||||
use App\Services\Trees\TreeViewGenerator;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
|
||||
|
||||
/**
|
||||
|
@ -41,7 +39,7 @@ class TreeViewGeneratorTest extends WebTestCase
|
|||
protected $service;
|
||||
protected $em;
|
||||
|
||||
public function setUp() : void
|
||||
public function setUp(): void
|
||||
{
|
||||
parent::setUp(); // TODO: Change the autogenerated stub
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue