@@ -183,9 +183,11 @@ public function testGetPushPayloadsNoHit(): void
183183
184184 $ cacheItemProphecy = $ this ->prophesize (CacheItemInterface::class);
185185 $ cacheItemProphecy ->isHit ()->willReturn (false );
186+ $ cacheItemProphecy ->isHit ()->willReturn (false );
186187 $ this ->subscriptionsCacheProphecy ->getItem ('_dummies_2 ' )->willReturn ($ cacheItemProphecy ->reveal ());
188+ $ this ->subscriptionsCacheProphecy ->getItem ('_dummies ' )->willReturn ($ cacheItemProphecy ->reveal ());
187189
188- $ this ->assertEquals ([], $ this ->subscriptionManager ->getPushPayloads ($ object ));
190+ $ this ->assertEquals ([], $ this ->subscriptionManager ->getPushPayloads ($ object, ' update ' ));
189191 }
190192
191193 public function testGetPushPayloadsHit (): void
@@ -199,16 +201,17 @@ public function testGetPushPayloadsHit(): void
199201 $ this ->iriConverterProphecy ->getIriFromResource ($ object )->willReturn ('/dummies/2 ' );
200202
201203 $ cacheItemProphecy = $ this ->prophesize (CacheItemInterface::class);
202- $ cacheItemProphecy ->isHit ()->willReturn (true );
204+ $ cacheItemProphecy ->isHit ()->willReturn (true )-> shouldBeCalledTimes ( 2 ) ;
203205 $ cacheItemProphecy ->get ()->willReturn ([
204206 ['subscriptionIdFoo ' , ['fieldsFoo ' ], ['resultFoo ' ]],
205207 ['subscriptionIdBar ' , ['fieldsBar ' ], ['resultBar ' ]],
206208 ]);
207209 $ this ->subscriptionsCacheProphecy ->getItem ('_dummies_2 ' )->willReturn ($ cacheItemProphecy ->reveal ());
210+ $ this ->subscriptionsCacheProphecy ->getItem ('_dummies ' )->willReturn ($ cacheItemProphecy ->reveal ());
208211
209212 $ this ->normalizeProcessor ->process (
210213 $ object ,
211- (new Subscription ())->withName ('update_subscription ' )->withShortName ('Dummy ' ),
214+ (new Subscription ())->withName ('mercure_subscription ' )->withShortName ('Dummy ' ),
212215 [],
213216 ['fields ' => ['fieldsFoo ' ], 'is_collection ' => false , 'is_mutation ' => false , 'is_subscription ' => true ]
214217 )->willReturn (
@@ -217,13 +220,13 @@ public function testGetPushPayloadsHit(): void
217220
218221 $ this ->normalizeProcessor ->process (
219222 $ object ,
220- (new Subscription ())->withName ('update_subscription ' )->withShortName ('Dummy ' ),
223+ (new Subscription ())->withName ('mercure_subscription ' )->withShortName ('Dummy ' ),
221224 [],
222225 ['fields ' => ['fieldsBar ' ], 'is_collection ' => false , 'is_mutation ' => false , 'is_subscription ' => true ]
223226 )->willReturn (
224227 ['resultBar ' , 'clientSubscriptionId ' => 'client-subscription-id ' ]
225228 );
226229
227- $ this ->assertEquals ([['subscriptionIdFoo ' , ['newResultFoo ' ]]], $ this ->subscriptionManager ->getPushPayloads ($ object ));
230+ $ this ->assertEquals ([['subscriptionIdFoo ' , ['newResultFoo ' ]]], $ this ->subscriptionManager ->getPushPayloads ($ object, ' update ' ));
228231 }
229232}
0 commit comments