diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 571924a2..3e120cc7 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -14,11 +14,7 @@ - . - - tests - vendor - + src diff --git a/tests/AnnotationGenerator/ApiPlatformCoreAnnotationGeneratorTest.php b/tests/AnnotationGenerator/ApiPlatformCoreAnnotationGeneratorTest.php index a2ea8f2d..1da55e81 100644 --- a/tests/AnnotationGenerator/ApiPlatformCoreAnnotationGeneratorTest.php +++ b/tests/AnnotationGenerator/ApiPlatformCoreAnnotationGeneratorTest.php @@ -59,23 +59,23 @@ protected function setUp(): void ); } - public function testGenerateClassAnnotations() + public function testGenerateClassAnnotations(): void { $this->assertSame(['@ApiResource(iri="http://schema.org/Res")'], $this->generator->generateClassAnnotations('Res')); } - public function testGenerateClassAnnotationsWithOperations() + public function testGenerateClassAnnotationsWithOperations(): void { $this->assertSame(['@ApiResource(iri="http://schema.org/WithOperations", itemOperations={"get"={"route_name"="api_about_get"}}, collectionOperations={})'], $this->generator->generateClassAnnotations('WithOperations')); } - public function testGenerateFieldAnnotations() + public function testGenerateFieldAnnotations(): void { $this->assertSame(['@ApiProperty(iri="http://schema.org/prop")'], $this->generator->generateFieldAnnotations('Res', 'prop')); $this->assertSame([], $this->generator->generateFieldAnnotations('Res', 'customProp')); } - public function testGenerateUses() + public function testGenerateUses(): void { $this->assertSame(['ApiPlatform\Core\Annotation\ApiResource', 'ApiPlatform\Core\Annotation\ApiProperty'], $this->generator->generateUses('Res')); $this->assertSame([], $this->generator->generateUses('MyEnum')); diff --git a/tests/AnnotationGenerator/DoctrineOrmAnnotationGeneratorTest.php b/tests/AnnotationGenerator/DoctrineOrmAnnotationGeneratorTest.php index 216c3150..526436dc 100644 --- a/tests/AnnotationGenerator/DoctrineOrmAnnotationGeneratorTest.php +++ b/tests/AnnotationGenerator/DoctrineOrmAnnotationGeneratorTest.php @@ -28,7 +28,7 @@ class DoctrineOrmAnnotationGeneratorTest extends TestCase */ private $generator; - public function setUp() + protected function setUp(): void { $graph = new \EasyRdf_Graph(); $myEnum = new \EasyRdf_Resource('https://schema.org/MyEnum', $graph); @@ -79,7 +79,7 @@ public function setUp() ); } - public function testGenerateClassAnnotations() + public function testGenerateClassAnnotations(): void { $this->assertSame([], $this->generator->generateClassAnnotations('MyEnum')); $this->assertSame(['', '@ORM\MappedSuperclass'], $this->generator->generateClassAnnotations('Product')); @@ -87,7 +87,7 @@ public function testGenerateClassAnnotations() $this->assertSame(['', '@ORM\Embeddable'], $this->generator->generateClassAnnotations('QuantitativeValue')); } - public function testGenerateFieldAnnotations() + public function testGenerateFieldAnnotations(): void { $this->assertSame( ['@ORM\Embedded(class="QuantitativeValue", columnPrefix=false)'], diff --git a/tests/Command/DumpConfigurationTest.php b/tests/Command/DumpConfigurationTest.php index 1a9b72e2..9000a884 100644 --- a/tests/Command/DumpConfigurationTest.php +++ b/tests/Command/DumpConfigurationTest.php @@ -22,7 +22,7 @@ */ class DumpConfigurationTest extends TestCase { - public function testDumpConfiguration() + public function testDumpConfiguration(): void { $commandTester = new CommandTester(new DumpConfigurationCommand()); $this->assertEquals(0, $commandTester->execute([])); diff --git a/tests/Command/ExtractCardinalitiesCommandTest.php b/tests/Command/ExtractCardinalitiesCommandTest.php index fb3ba6a1..419604f2 100644 --- a/tests/Command/ExtractCardinalitiesCommandTest.php +++ b/tests/Command/ExtractCardinalitiesCommandTest.php @@ -22,7 +22,7 @@ */ class ExtractCardinalitiesCommandTest extends TestCase { - public function testExtractCardinalities() + public function testExtractCardinalities(): void { $commandTester = new CommandTester(new ExtractCardinalitiesCommand()); $this->assertEquals(0, $commandTester->execute( diff --git a/tests/Command/GenerateTypesCommandTest.php b/tests/Command/GenerateTypesCommandTest.php index 2a9c7ea8..b8d2a626 100644 --- a/tests/Command/GenerateTypesCommandTest.php +++ b/tests/Command/GenerateTypesCommandTest.php @@ -36,7 +36,7 @@ protected function setUp(): void /** * @dataProvider getArguments */ - public function testCommand($output, $config) + public function testCommand($output, $config): void { $this->fs->mkdir($output); @@ -44,7 +44,7 @@ public function testCommand($output, $config) $this->assertEquals(0, $commandTester->execute(['output' => $output, 'config' => $config])); } - public function getArguments() + public function getArguments(): array { return [ [__DIR__.'/../../build/blog/', __DIR__.'/../config/blog.yaml'], @@ -55,7 +55,7 @@ public function getArguments() ]; } - public function testDoctrineCollection() + public function testDoctrineCollection(): void { $outputDir = __DIR__.'/../../build/address-book'; $config = __DIR__.'/../config/address-book.yaml'; @@ -78,7 +78,7 @@ public function getFriends(): Collection , $person); } - public function testFluentMutators() + public function testFluentMutators(): void { $outputDir = __DIR__.'/../../build/fluent-mutators'; $config = __DIR__.'/../config/fluent-mutators.yaml'; @@ -115,7 +115,7 @@ public function removeFriend(Person $friend): self , $person); } - public function testDoNotGenerateAccessorMethods() + public function testDoNotGenerateAccessorMethods(): void { $outputDir = __DIR__.'/../../build/public-properties'; $config = __DIR__.'/../config/public-properties.yaml'; @@ -132,7 +132,7 @@ public function testDoNotGenerateAccessorMethods() $this->assertNotContains('function remove', $person); } - public function testImplicitAndExplicitPropertyInheritance() + public function testImplicitAndExplicitPropertyInheritance(): void { $outputDir = __DIR__.'/../../build/inherited-properties'; $config = __DIR__.'/../config/inherited-properties.yaml'; @@ -164,7 +164,7 @@ public function testImplicitAndExplicitPropertyInheritance() $this->assertNotContains('function setName(', $webPage); } - public function testReadableWritable() + public function testReadableWritable(): void { $outputDir = __DIR__.'/../../build/readable-writable'; $config = __DIR__.'/../config/readable-writable.yaml'; @@ -184,7 +184,7 @@ public function testReadableWritable() $this->assertNotContains('function removeFriend(', $person); } - public function testGeneratedId() + public function testGeneratedId(): void { $outputDir = __DIR__.'/../../build/generated-id'; $config = __DIR__.'/../config/generated-id.yaml'; @@ -219,7 +219,7 @@ public function getId(): ?int $this->assertNotContains('function setId(', $person); } - public function testNonGeneratedId() + public function testNonGeneratedId(): void { $outputDir = __DIR__.'/../../build/non-generated-id'; $config = __DIR__.'/../config/non-generated-id.yaml'; @@ -253,7 +253,7 @@ public function getId(): string $this->assertContains('public function setId(string $id): void', $person); } - public function testGeneratedUuid() + public function testGeneratedUuid(): void { $outputDir = __DIR__.'/../../build/generated-uuid'; $config = __DIR__.'/../config/generated-uuid.yaml'; @@ -289,7 +289,7 @@ public function getId(): ?string $this->assertNotContains('function setId(', $person); } - public function testNonGeneratedUuid() + public function testNonGeneratedUuid(): void { $outputDir = __DIR__.'/../../build/non-generated-uuid'; $config = __DIR__.'/../config/non-generated-uuid.yaml'; @@ -324,7 +324,7 @@ public function getId(): string $this->assertContains('public function setId(string $id): void', $person); } - public function testDoNotGenerateId() + public function testDoNotGenerateId(): void { $outputDir = __DIR__.'/../../build/no-id'; $config = __DIR__.'/../config/no-id.yaml'; @@ -341,7 +341,7 @@ public function testDoNotGenerateId() $this->assertNotContains('function setId', $person); } - public function testNamespacesPrefix() + public function testNamespacesPrefix(): void { $outputDir = __DIR__.'/../../build/namespaces-prefix'; $config = __DIR__.'/../config/namespaces-prefix.yaml'; @@ -356,7 +356,7 @@ public function testNamespacesPrefix() $this->assertContains('namespace App\Entity;', $person); } - public function testNamespacesPrefixAutodetect() + public function testNamespacesPrefixAutodetect(): void { $outputDir = __DIR__.'/../../build/namespaces-prefix-autodetect/'; @@ -378,7 +378,7 @@ public function testNamespacesPrefixAutodetect() } } - public function testGeneratedEnum() + public function testGeneratedEnum(): void { $outputDir = __DIR__.'/../../build/enum'; $config = __DIR__.'/../config/enum.yaml'; @@ -401,7 +401,7 @@ public function testGeneratedEnum() $this->assertNotContains('function setId(', $gender); } - public function testSupersededProperties() + public function testSupersededProperties(): void { $outputDir = __DIR__.'/../../build/superseded-properties'; $config = __DIR__.'/../config/superseded-properties.yaml'; diff --git a/tests/TypesGeneratorTest.php b/tests/TypesGeneratorTest.php index 04601020..29465374 100644 --- a/tests/TypesGeneratorTest.php +++ b/tests/TypesGeneratorTest.php @@ -390,7 +390,7 @@ private function getClasses(): array * * @return \Closure */ - private function getContextMatcher(array $class) + private function getContextMatcher(array $class): \Closure { $config = $this->getConfig();