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

Fixed creationContext not being passed to abstract factory canCreate() #79

Closed
wants to merge 1 commit into from

Conversation

kynx
Copy link
Contributor

@kynx kynx commented Jan 23, 2016

Fix for #78

@kynx
Copy link
Contributor Author

kynx commented Jan 24, 2016

Ping @weierophinney @ezimuel

@Ocramius Ocramius self-assigned this Jan 24, 2016
@Ocramius Ocramius added the bug label Jan 24, 2016
@Ocramius Ocramius added this to the 3.0.2 milestone Jan 24, 2016
Ocramius added a commit that referenced this pull request Jan 24, 2016
@Ocramius Ocramius closed this in c966f49 Jan 24, 2016
@Ocramius
Copy link
Member

@kynx merged, thanks!

$serviceManager = new ServiceManager();
$pluginManager = new TestAsset\SimplePluginManager($serviceManager);
$abstractFactory = $this->prophesize(AbstractFactoryInterface::class);
$abstractFactory->canCreate($serviceManager, 'foo')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldBeCalled() should be added (as far as I remember, without shouldBeCalled this assertion does nothing actually, and changing foo to something completely different does not throw any error... but I may be wrong. Mind testing @Ocramius ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

True. But the intention was to catch the situation where canCreate() was called with the $pluginManager instead of the $serviceManager, which it does (in a rather ugly fashion ;)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants