Skip to content
This repository was archived by the owner on Feb 6, 2020. It is now read-only.

Commit 74f7ca5

Browse files
author
fhein
committed
Fixed my fix.
1 parent 8fc6304 commit 74f7ca5

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

test/ServiceManagerTest.php

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,11 @@ public function testSetAliasShouldWorkWithRecursiveAlias()
272272
self::assertSame($service, $headAlias);
273273
}
274274

275+
public function emulateHas($name)
276+
{
277+
return $name === 'ServiceName';
278+
}
279+
275280
public function testAbstractFactoryShouldBeCheckedForResolvedAliasesInsteadOfAliasName()
276281
{
277282
$abstractFactory = $this->createMock(AbstractFactoryInterface::class);
@@ -285,12 +290,18 @@ public function testAbstractFactoryShouldBeCheckedForResolvedAliasesInsteadOfAli
285290
],
286291
]);
287292

293+
$valueMap = [
294+
['Alias', false],
295+
['ServiceName', true],
296+
];
297+
288298
$abstractFactory
289-
->expects(self::once())
290299
->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));
294305
$this->assertTrue($serviceManager->has('Alias'));
295306
}
296307

0 commit comments

Comments
 (0)