1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
declare(strict_types=1); |
4
|
|
|
|
5
|
|
|
namespace GraphQLTests\Doctrine; |
6
|
|
|
|
7
|
|
|
use Doctrine\ORM\Mapping\Column; |
8
|
|
|
use Doctrine\ORM\Mapping\Entity; |
9
|
|
|
use Doctrine\Persistence\Mapping\Driver\MappingDriverChain; |
10
|
|
|
use GraphQL\Doctrine\Factory\MetadataReader\MappingDriverChainAdapter; |
|
|
|
|
11
|
|
|
use GraphQLTests\Doctrine\Blog\Model\Post; |
12
|
|
|
use PHPUnit\Framework\TestCase; |
13
|
|
|
use ReflectionClass; |
14
|
|
|
use ReflectionMethod; |
15
|
|
|
use ReflectionProperty; |
16
|
|
|
|
17
|
|
|
final class MappingDriverChainAdapterTest extends TestCase |
18
|
|
|
{ |
19
|
|
|
use TypesTrait { |
20
|
|
|
setUp as typeSetup; |
21
|
|
|
} |
22
|
|
|
|
23
|
|
|
private MappingDriverChainAdapter $chainAdapter; |
24
|
|
|
|
25
|
|
|
protected function setUp(): void |
26
|
|
|
{ |
27
|
|
|
$this->typeSetup(); |
28
|
|
|
|
29
|
|
|
$config = $this->entityManager->getConfiguration(); |
30
|
|
|
$chain = new MappingDriverChain(); |
31
|
|
|
$chain->setDefaultDriver($config->getMetadataDriverImpl()); |
|
|
|
|
32
|
|
|
$this->chainAdapter = new MappingDriverChainAdapter($chain); |
33
|
|
|
} |
34
|
|
|
|
35
|
|
|
public function testGetClassAnnotations(): void |
36
|
|
|
{ |
37
|
|
|
self::assertNotEmpty($this->chainAdapter->getClassAnnotations(new ReflectionClass(Post::class))); |
38
|
|
|
} |
39
|
|
|
|
40
|
|
|
public function testGetClassAnnotation(): void |
41
|
|
|
{ |
42
|
|
|
self::assertNotNull($this->chainAdapter->getClassAnnotation(new ReflectionClass(Post::class), Entity::class)); |
43
|
|
|
} |
44
|
|
|
|
45
|
|
|
public function testGetMethodAnnotations(): void |
46
|
|
|
{ |
47
|
|
|
self::assertNotEmpty($this->chainAdapter->getMethodAnnotations(new ReflectionMethod(Post::class, 'getBody'))); |
48
|
|
|
} |
49
|
|
|
|
50
|
|
|
public function testGetMethodAnnotation(): void |
51
|
|
|
{ |
52
|
|
|
self::assertNotNull($this->chainAdapter->getMethodAnnotations(new ReflectionMethod(Post::class, 'getBody'))); |
53
|
|
|
} |
54
|
|
|
|
55
|
|
|
public function testGetPropertyAnnotations(): void |
56
|
|
|
{ |
57
|
|
|
self::assertNotEmpty($this->chainAdapter->getPropertyAnnotations(new ReflectionProperty(Post::class, 'body'))); |
58
|
|
|
} |
59
|
|
|
|
60
|
|
|
public function testGetPropertyAnnotation(): void |
61
|
|
|
{ |
62
|
|
|
self::assertNotNull($this->chainAdapter->getPropertyAnnotation(new ReflectionProperty(Post::class, 'body'), Column::class)); |
63
|
|
|
} |
64
|
|
|
} |
65
|
|
|
|
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"]
, you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths