21
21
use ApiPlatform \Core \Bridge \Symfony \Bundle \DependencyInjection \Compiler \AnnotationFilterPass ;
22
22
use ApiPlatform \Core \Serializer \Filter \GroupFilter ;
23
23
use ApiPlatform \Core \Tests \Fixtures \TestBundle \Doctrine \Orm \Filter \AnotherDummyFilter ;
24
+ use ApiPlatform \Core \Tests \Fixtures \TestBundle \Entity \Dummy ;
24
25
use Doctrine \Common \Annotations \Reader ;
25
26
use Prophecy \Argument ;
26
27
use Symfony \Component \DependencyInjection \Compiler \CompilerPassInterface ;
@@ -47,15 +48,15 @@ public function testProcess()
47
48
$ reader = $ this ->prophesize (Reader::class);
48
49
49
50
$ reader ->getPropertyAnnotations (Argument::type (\ReflectionProperty::class))->will (function ($ args ) {
50
- if ($ args [0 ]->class === ' ApiPlatform\Core\Tests\Fixtures\TestBundle\Entity\Dummy ' && $ args [0 ]->name === ' dummyDate ' ) {
51
+ if (Dummy::class === $ args [0 ]->class && ' dummyDate ' === $ args [0 ]->name ) {
51
52
return [new ApiFilter (['value ' => DateFilter::class]), new ApiProperty ()];
52
53
}
53
54
54
55
return [];
55
56
});
56
57
57
58
$ reader ->getClassAnnotations (Argument::type (\ReflectionClass::class))->will (function ($ args ) {
58
- if ($ args [0 ]->name === ' ApiPlatform\Core\Tests\Fixtures\TestBundle\Entity\Dummy ' ) {
59
+ if (Dummy::class === $ args [0 ]->name ) {
59
60
return [new ApiFilter (['value ' => SearchFilter::class, 'strategy ' => 'exact ' , 'properties ' => ['description ' , 'relatedDummy.name ' , 'name ' ]]), new ApiResource (), new ApiFilter (['value ' => GroupFilter::class, 'arguments ' => ['parameterName ' => 'foobar ' ]])];
60
61
}
61
62
@@ -118,7 +119,7 @@ public function testProcessWrongFilter()
118
119
});
119
120
120
121
$ reader ->getClassAnnotations (Argument::type (\ReflectionClass::class))->will (function ($ args ) {
121
- if ($ args [0 ]->name === ' ApiPlatform\Core\Tests\Fixtures\TestBundle\Entity\Dummy ' ) {
122
+ if (Dummy::class === $ args [0 ]->name ) {
122
123
return [new ApiFilter (['value ' => AnotherDummyFilter::class])];
123
124
}
124
125
@@ -149,7 +150,7 @@ public function testProcessExistingFilter()
149
150
});
150
151
151
152
$ reader ->getClassAnnotations (Argument::type (\ReflectionClass::class))->will (function ($ args ) {
152
- if ($ args [0 ]->name === ' ApiPlatform\Core\Tests\Fixtures\TestBundle\Entity\Dummy ' ) {
153
+ if (Dummy::class === $ args [0 ]->name ) {
153
154
return [new ApiFilter (['value ' => SearchFilter::class])];
154
155
}
155
156
0 commit comments