This repository was archived by the owner on Feb 6, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +15
-4
lines changed Expand file tree Collapse file tree 1 file changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -272,6 +272,11 @@ public function testSetAliasShouldWorkWithRecursiveAlias()
272
272
self ::assertSame ($ service , $ headAlias );
273
273
}
274
274
275
+ public function emulateHas ($ name )
276
+ {
277
+ return $ name === 'ServiceName ' ;
278
+ }
279
+
275
280
public function testAbstractFactoryShouldBeCheckedForResolvedAliasesInsteadOfAliasName ()
276
281
{
277
282
$ abstractFactory = $ this ->createMock (AbstractFactoryInterface::class);
@@ -285,12 +290,18 @@ public function testAbstractFactoryShouldBeCheckedForResolvedAliasesInsteadOfAli
285
290
],
286
291
]);
287
292
293
+ $ valueMap = [
294
+ ['Alias ' , false ],
295
+ ['ServiceName ' , true ],
296
+ ];
297
+
288
298
$ abstractFactory
289
- ->expects (self ::once ())
290
299
->method ('canCreate ' )
291
- ->with ($ this ->anything ())
292
- ->willReturn ($ this ->equalTo ('ServiceName ' ));
293
-
300
+ ->withConsecutive (
301
+ [ $ this ->anything (), $ this ->equalTo ('Alias ' ) ],
302
+ [ $ this ->anything (), $ this ->equalTo ('ServiceName ' )]
303
+ )
304
+ ->willReturn ($ this ->returnValueMap ($ valueMap ));
294
305
$ this ->assertTrue ($ serviceManager ->has ('Alias ' ));
295
306
}
296
307
You can’t perform that action at this time.
0 commit comments