mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2026-02-04 08:29:35 +00:00
Fixed inspection issues.
This commit is contained in:
parent
0fe83c7b3a
commit
eb9b24d5d7
20 changed files with 33 additions and 49 deletions
|
|
@ -73,7 +73,7 @@ class ApplicationAvailabilityFunctionalTest extends WebTestCase
|
|||
$this->assertTrue($client->getResponse()->isSuccessful(), 'Request not successful. Status code is '.$client->getResponse()->getStatusCode());
|
||||
}
|
||||
|
||||
public function urlProvider()
|
||||
public function urlProvider(): ?\Generator
|
||||
{
|
||||
//Homepage
|
||||
//yield ['/'];
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ abstract class AbstractAdminControllerTest extends WebTestCase
|
|||
protected static $base_path = 'not_valid';
|
||||
protected static $entity_class = 'not valid';
|
||||
|
||||
public function readDataProvider()
|
||||
public function readDataProvider(): array
|
||||
{
|
||||
return [
|
||||
['noread', false],
|
||||
|
|
@ -118,7 +118,7 @@ abstract class AbstractAdminControllerTest extends WebTestCase
|
|||
$this->assertSame($read, ! $client->getResponse()->isForbidden(), 'Permission Checking not working!');
|
||||
}
|
||||
|
||||
public function deleteDataProvider()
|
||||
public function deleteDataProvider(): array
|
||||
{
|
||||
return [
|
||||
['noread', false],
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ class DatatablesAvailabilityTest extends WebTestCase
|
|||
$this->assertJson($client->getResponse()->getContent());
|
||||
}
|
||||
|
||||
public function urlProvider()
|
||||
public function urlProvider(): ?\Generator
|
||||
{
|
||||
//Part lists
|
||||
yield ['/category/1/parts'];
|
||||
|
|
|
|||
|
|
@ -145,7 +145,7 @@ class AttachmentTest extends TestCase
|
|||
$attachment->setElement($element);
|
||||
}
|
||||
|
||||
public function externalDataProvider()
|
||||
public function externalDataProvider(): array
|
||||
{
|
||||
return [
|
||||
['', false],
|
||||
|
|
@ -170,7 +170,7 @@ class AttachmentTest extends TestCase
|
|||
$this->assertSame($expected, $attachment->isExternal());
|
||||
}
|
||||
|
||||
public function extensionDataProvider()
|
||||
public function extensionDataProvider(): array
|
||||
{
|
||||
return [
|
||||
['%MEDIA%/foo/bar.txt', null, 'txt'],
|
||||
|
|
@ -197,7 +197,7 @@ class AttachmentTest extends TestCase
|
|||
$this->assertSame($expected, $attachment->getExtension());
|
||||
}
|
||||
|
||||
public function pictureDataProvider()
|
||||
public function pictureDataProvider(): array
|
||||
{
|
||||
return [
|
||||
['%MEDIA%/foo/bar.txt', false],
|
||||
|
|
@ -221,7 +221,7 @@ class AttachmentTest extends TestCase
|
|||
$this->assertSame($expected, $attachment->isPicture());
|
||||
}
|
||||
|
||||
public function builtinDataProvider()
|
||||
public function builtinDataProvider(): array
|
||||
{
|
||||
return [
|
||||
['', false],
|
||||
|
|
@ -243,7 +243,7 @@ class AttachmentTest extends TestCase
|
|||
$this->assertSame($expected, $attachment->isBuiltIn());
|
||||
}
|
||||
|
||||
public function hostDataProvider()
|
||||
public function hostDataProvider(): array
|
||||
{
|
||||
return [
|
||||
['%MEDIA%/foo/bar.txt', null],
|
||||
|
|
@ -262,7 +262,7 @@ class AttachmentTest extends TestCase
|
|||
$this->assertSame($expected, $attachment->getHost());
|
||||
}
|
||||
|
||||
public function filenameProvider()
|
||||
public function filenameProvider(): array
|
||||
{
|
||||
return [
|
||||
['%MEDIA%/foo/bar.txt', null, 'bar.txt'],
|
||||
|
|
|
|||
|
|
@ -139,7 +139,7 @@ class AbstractLogEntryTest extends TestCase
|
|||
$this->assertSame(10, $log->getTargetID());
|
||||
|
||||
$log->setTargetElement(null);
|
||||
$this->assertSame(null, $log->getTargetClass());
|
||||
$this->assertSame(null, $log->getTargetID());
|
||||
$this->assertNull($log->getTargetClass());
|
||||
$this->assertNull($log->getTargetID());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -46,7 +46,6 @@ use App\Entity\Attachments\AttachmentType;
|
|||
use App\Entity\Parts\Category;
|
||||
use InvalidArgumentException;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use Symfony\Component\Yaml\Tests\A;
|
||||
|
||||
/**
|
||||
* Test StructuralDBElement entities.
|
||||
|
|
|
|||
|
|
@ -43,7 +43,6 @@ declare(strict_types=1);
|
|||
namespace App\Tests\Entity\UserSystem;
|
||||
|
||||
use App\Entity\UserSystem\PermissionsEmbed;
|
||||
use Doctrine\ORM\Mapping\Embedded;
|
||||
use InvalidArgumentException;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use ReflectionClass;
|
||||
|
|
@ -137,7 +136,7 @@ class PermissionsEmbedTest extends TestCase
|
|||
$embed->getPermissionValue('parts', 1);
|
||||
}
|
||||
|
||||
public function getStatesBINARY()
|
||||
public function getStatesBINARY(): array
|
||||
{
|
||||
return [
|
||||
'ALLOW' => [PermissionsEmbed::ALLOW],
|
||||
|
|
@ -147,7 +146,7 @@ class PermissionsEmbedTest extends TestCase
|
|||
];
|
||||
}
|
||||
|
||||
public function getStatesBOOL()
|
||||
public function getStatesBOOL(): array
|
||||
{
|
||||
return [
|
||||
'ALLOW' => [true],
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ class BBCodeToMarkdownConverterTest extends TestCase
|
|||
$this->converter = new BBCodeToMarkdownConverter();
|
||||
}
|
||||
|
||||
public function dataProvider()
|
||||
public function dataProvider(): array
|
||||
{
|
||||
return [
|
||||
['[b]Bold[/b]', '**Bold**'],
|
||||
|
|
|
|||
|
|
@ -95,7 +95,7 @@ class AttachmentPathResolverTest extends WebTestCase
|
|||
$this->assertNull(self::$service->parameterToAbsolutePath('/./this/one/too'));
|
||||
}
|
||||
|
||||
public function placeholderDataProvider()
|
||||
public function placeholderDataProvider(): array
|
||||
{
|
||||
return [
|
||||
['%FOOTPRINTS%/test/test.jpg', self::$footprint_path.'/test/test.jpg'],
|
||||
|
|
@ -117,7 +117,7 @@ class AttachmentPathResolverTest extends WebTestCase
|
|||
];
|
||||
}
|
||||
|
||||
public function realPathDataProvider()
|
||||
public function realPathDataProvider(): array
|
||||
{
|
||||
return [
|
||||
[self::$media_path.'/test/img.jpg', '%MEDIA%/test/img.jpg'],
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@ class AttachmentURLGeneratorTest extends WebTestCase
|
|||
self::$service = self::$container->get(AttachmentURLGenerator::class);
|
||||
}
|
||||
|
||||
public function dataProvider()
|
||||
public function dataProvider(): array
|
||||
{
|
||||
return [
|
||||
['/public/test.jpg', 'test.jpg'],
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@ class BuiltinAttachmentsFinderTest extends WebTestCase
|
|||
self::$service = self::$container->get(BuiltinAttachmentsFinder::class);
|
||||
}
|
||||
|
||||
public function dataProvider()
|
||||
public function dataProvider(): array
|
||||
{
|
||||
return [
|
||||
//No value should return empty array
|
||||
|
|
|
|||
|
|
@ -109,7 +109,7 @@ class PermissionResolverTest extends WebTestCase
|
|||
$this->group->method('getParent')->willReturn($parent_group);
|
||||
}
|
||||
|
||||
public function getPermissionNames()
|
||||
public function getPermissionNames(): array
|
||||
{
|
||||
//List all possible operation names.
|
||||
return [
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@ class PricedetailHelperTest extends WebTestCase
|
|||
$this->service = self::$container->get(PricedetailHelper::class);
|
||||
}
|
||||
|
||||
public function maxDiscountAmountDataProvider()
|
||||
public function maxDiscountAmountDataProvider(): ?\Generator
|
||||
{
|
||||
$part = new Part();
|
||||
yield [$part, null, 'Part without any orderdetails failed!'];
|
||||
|
|
|
|||
|
|
@ -66,7 +66,7 @@ class BackupCodeGeneratorTest extends TestCase
|
|||
new BackupCodeGenerator(4, 10);
|
||||
}
|
||||
|
||||
public function codeLengthDataProvider()
|
||||
public function codeLengthDataProvider(): array
|
||||
{
|
||||
return [[6], [8], [10], [16]];
|
||||
}
|
||||
|
|
@ -80,7 +80,7 @@ class BackupCodeGeneratorTest extends TestCase
|
|||
$this->assertRegExp("/^([a-f0-9]){{$code_length}}\$/", $generator->generateSingleCode());
|
||||
}
|
||||
|
||||
public function codeCountDataProvider()
|
||||
public function codeCountDataProvider(): array
|
||||
{
|
||||
return [[2], [8], [10]];
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue