@@ -183,9 +183,11 @@ public function testGetPushPayloadsNoHit(): void
183
183
184
184
$ cacheItemProphecy = $ this ->prophesize (CacheItemInterface::class);
185
185
$ cacheItemProphecy ->isHit ()->willReturn (false );
186
+ $ cacheItemProphecy ->isHit ()->willReturn (false );
186
187
$ this ->subscriptionsCacheProphecy ->getItem ('_dummies_2 ' )->willReturn ($ cacheItemProphecy ->reveal ());
188
+ $ this ->subscriptionsCacheProphecy ->getItem ('_dummies ' )->willReturn ($ cacheItemProphecy ->reveal ());
187
189
188
- $ this ->assertEquals ([], $ this ->subscriptionManager ->getPushPayloads ($ object ));
190
+ $ this ->assertEquals ([], $ this ->subscriptionManager ->getPushPayloads ($ object, ' update ' ));
189
191
}
190
192
191
193
public function testGetPushPayloadsHit (): void
@@ -199,16 +201,17 @@ public function testGetPushPayloadsHit(): void
199
201
$ this ->iriConverterProphecy ->getIriFromResource ($ object )->willReturn ('/dummies/2 ' );
200
202
201
203
$ cacheItemProphecy = $ this ->prophesize (CacheItemInterface::class);
202
- $ cacheItemProphecy ->isHit ()->willReturn (true );
204
+ $ cacheItemProphecy ->isHit ()->willReturn (true )-> shouldBeCalledTimes ( 2 ) ;
203
205
$ cacheItemProphecy ->get ()->willReturn ([
204
206
['subscriptionIdFoo ' , ['fieldsFoo ' ], ['resultFoo ' ]],
205
207
['subscriptionIdBar ' , ['fieldsBar ' ], ['resultBar ' ]],
206
208
]);
207
209
$ this ->subscriptionsCacheProphecy ->getItem ('_dummies_2 ' )->willReturn ($ cacheItemProphecy ->reveal ());
210
+ $ this ->subscriptionsCacheProphecy ->getItem ('_dummies ' )->willReturn ($ cacheItemProphecy ->reveal ());
208
211
209
212
$ this ->normalizeProcessor ->process (
210
213
$ object ,
211
- (new Subscription ())->withName ('update_subscription ' )->withShortName ('Dummy ' ),
214
+ (new Subscription ())->withName ('mercure_subscription ' )->withShortName ('Dummy ' ),
212
215
[],
213
216
['fields ' => ['fieldsFoo ' ], 'is_collection ' => false , 'is_mutation ' => false , 'is_subscription ' => true ]
214
217
)->willReturn (
@@ -217,13 +220,13 @@ public function testGetPushPayloadsHit(): void
217
220
218
221
$ this ->normalizeProcessor ->process (
219
222
$ object ,
220
- (new Subscription ())->withName ('update_subscription ' )->withShortName ('Dummy ' ),
223
+ (new Subscription ())->withName ('mercure_subscription ' )->withShortName ('Dummy ' ),
221
224
[],
222
225
['fields ' => ['fieldsBar ' ], 'is_collection ' => false , 'is_mutation ' => false , 'is_subscription ' => true ]
223
226
)->willReturn (
224
227
['resultBar ' , 'clientSubscriptionId ' => 'client-subscription-id ' ]
225
228
);
226
229
227
- $ this ->assertEquals ([['subscriptionIdFoo ' , ['newResultFoo ' ]]], $ this ->subscriptionManager ->getPushPayloads ($ object ));
230
+ $ this ->assertEquals ([['subscriptionIdFoo ' , ['newResultFoo ' ]]], $ this ->subscriptionManager ->getPushPayloads ($ object, ' update ' ));
228
231
}
229
232
}
0 commit comments