15
15
16
16
use ApiPlatform \Core \Bridge \Symfony \Bundle \DataProvider \TraceableChainItemDataProvider ;
17
17
use ApiPlatform \Core \DataProvider \ChainItemDataProvider ;
18
- use ApiPlatform \Core \DataProvider \DenormalizedIdentifiersAwareItemDataProviderInterface ;
19
18
use ApiPlatform \Core \DataProvider \ItemDataProviderInterface ;
20
19
use ApiPlatform \Core \DataProvider \RestrictedDataProviderInterface ;
21
20
use ApiPlatform \Core \Exception \ResourceClassNotSupportedException ;
@@ -30,7 +29,7 @@ class TraceableChainItemDataCollectorTest extends TestCase
30
29
public function testGetItem ($ provider , $ context , $ expected )
31
30
{
32
31
$ dataProvider = new TraceableChainItemDataProvider ($ provider );
33
- $ dataProvider ->getItem ('' , '' , null , $ context );
32
+ $ dataProvider ->getItem ('' , [] , null , $ context );
34
33
35
34
$ result = $ dataProvider ->getProvidersResponse ();
36
35
$ this ->assertCount (\count ($ expected ), $ result );
@@ -48,7 +47,7 @@ public function testGetItem($provider, $context, $expected)
48
47
public function testDeprecatedGetItem ($ provider , $ context , $ expected )
49
48
{
50
49
$ dataProvider = new TraceableChainItemDataProvider ($ provider );
51
- $ dataProvider ->getItem ('' , '' , null , $ context );
50
+ $ dataProvider ->getItem ('' , [] , null , $ context );
52
51
53
52
$ result = $ dataProvider ->getProvidersResponse ();
54
53
$ this ->assertCount (\count ($ expected ), $ result );
@@ -63,7 +62,7 @@ public function dataProviderProvider(): iterable
63
62
{
64
63
yield 'Not a ChainItemDataProvider ' => [
65
64
new class () implements ItemDataProviderInterface {
66
- public function getItem (string $ resourceClass , $ id , string $ operationName = null , array $ context = [])
65
+ public function getItem (string $ resourceClass , array $ identifiers , string $ operationName = null , array $ context = [])
67
66
{
68
67
return null ;
69
68
}
@@ -86,13 +85,13 @@ public function supports(string $resourceClass, string $operationName = null, ar
86
85
return false ;
87
86
}
88
87
89
- public function getItem (string $ resourceClass , $ id , string $ operationName = null , array $ context = [])
88
+ public function getItem (string $ resourceClass , array $ identifiers , string $ operationName = null , array $ context = [])
90
89
{
91
90
return null ;
92
91
}
93
92
},
94
- new class () implements RestrictedDataProviderInterface, DenormalizedIdentifiersAwareItemDataProviderInterface {
95
- public function getItem (string $ resourceClass , /* array */ $ id , string $ operationName = null , array $ context = [])
93
+ new class () implements RestrictedDataProviderInterface {
94
+ public function getItem (string $ resourceClass , array $ identifiers , string $ operationName = null , array $ context = [])
96
95
{
97
96
return null ;
98
97
}
@@ -103,7 +102,7 @@ public function supports(string $resourceClass, string $operationName = null, ar
103
102
}
104
103
},
105
104
new class () implements ItemDataProviderInterface {
106
- public function getItem (string $ resourceClass , $ id , string $ operationName = null , array $ context = [])
105
+ public function getItem (string $ resourceClass , array $ identifiers , string $ operationName = null , array $ context = [])
107
106
{
108
107
return null ;
109
108
}
0 commit comments