1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
declare(strict_types=1); |
4
|
|
|
|
5
|
|
|
namespace GraphQLTests\Doctrine; |
6
|
|
|
|
7
|
|
|
use Doctrine\Common\Persistence\Mapping\Driver\MappingDriverChain; |
|
|
|
|
8
|
|
|
use Doctrine\ORM\Mapping\Column; |
9
|
|
|
use Doctrine\ORM\Mapping\Entity; |
10
|
|
|
use GraphQL\Doctrine\Factory\MetadataReader\MappingDriverChainAdapter; |
11
|
|
|
use GraphQLTests\Doctrine\Blog\Model\Post; |
12
|
|
|
use ReflectionClass; |
13
|
|
|
use ReflectionMethod; |
14
|
|
|
use ReflectionProperty; |
15
|
|
|
|
16
|
|
|
final class MappingDriverChainAdapterTest extends \PHPUnit\Framework\TestCase |
17
|
|
|
{ |
18
|
|
|
use TypesTrait { |
19
|
|
|
setUp as typeSetup; |
20
|
|
|
} |
21
|
|
|
|
22
|
|
|
/** |
23
|
|
|
* @var MappingDriverChainAdapter |
24
|
|
|
*/ |
25
|
|
|
private $chainAdapter; |
26
|
|
|
|
27
|
|
|
protected function setUp(): void |
28
|
|
|
{ |
29
|
|
|
$this->typeSetup(); |
30
|
|
|
|
31
|
|
|
$config = $this->entityManager->getConfiguration(); |
32
|
|
|
$chain = new MappingDriverChain(); |
33
|
|
|
$chain->setDefaultDriver($config->getMetadataDriverImpl()); |
34
|
|
|
$this->chainAdapter = new MappingDriverChainAdapter($chain); |
35
|
|
|
} |
36
|
|
|
|
37
|
|
|
public function testGetClassAnnotations(): void |
38
|
|
|
{ |
39
|
|
|
self::assertNotEmpty($this->chainAdapter->getClassAnnotations(new ReflectionClass(Post::class))); |
40
|
|
|
} |
41
|
|
|
|
42
|
|
|
public function testGetClassAnnotation(): void |
43
|
|
|
{ |
44
|
|
|
self::assertNotNull($this->chainAdapter->getClassAnnotation(new ReflectionClass(Post::class), Entity::class)); |
45
|
|
|
} |
46
|
|
|
|
47
|
|
|
public function testGetMethodAnnotations(): void |
48
|
|
|
{ |
49
|
|
|
self::assertNotEmpty($this->chainAdapter->getMethodAnnotations(new ReflectionMethod(Post::class, 'getBody'))); |
50
|
|
|
} |
51
|
|
|
|
52
|
|
|
public function testGetMethodAnnotation(): void |
53
|
|
|
{ |
54
|
|
|
self::assertNotNull($this->chainAdapter->getMethodAnnotations(new ReflectionMethod(Post::class, 'getBody'))); |
55
|
|
|
} |
56
|
|
|
|
57
|
|
|
public function testGetPropertyAnnotations(): void |
58
|
|
|
{ |
59
|
|
|
self::assertNotEmpty($this->chainAdapter->getPropertyAnnotations(new ReflectionProperty(Post::class, 'body'))); |
60
|
|
|
} |
61
|
|
|
|
62
|
|
|
public function testGetPropertyAnnotation(): void |
63
|
|
|
{ |
64
|
|
|
self::assertNotNull($this->chainAdapter->getPropertyAnnotation(new ReflectionProperty(Post::class, 'body'), Column::class)); |
65
|
|
|
} |
66
|
|
|
} |
67
|
|
|
|
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