I discovered an issue using fixtures when extending from MagentoContext. I found I couldn't access the FixtureFactory unless I extended from RawMagentoContext (which has a getFixtureFactory() method) - but that caused problems because it contains all the steps defined in MinkContext, which caused duplication and threw ambiguous exceptions.
My solution to this was to implement getFixtureFactory() in MagentoContext. It seems like this method was omitted originally, as all the other private properties ($app, $configManager, $cacheManager, $sessionService) have getters and setters, but $factory only has a setter, and then getFixture().
I'm not sure whether this omission was intentional or accidental, I think the original intention was to use getFixture() to return these objects, but a change in the FixtureFactory implementation means this no longer works.
I discovered an issue using fixtures when extending from
MagentoContext
. I found I couldn't access theFixtureFactory
unless I extended fromRawMagentoContext
(which has agetFixtureFactory()
method) - but that caused problems because it contains all the steps defined inMinkContext
, which caused duplication and threw ambiguous exceptions.My solution to this was to implement
getFixtureFactory()
inMagentoContext
. It seems like this method was omitted originally, as all the other private properties ($app
,$configManager
,$cacheManager
,$sessionService
) have getters and setters, but$factory
only has a setter, and thengetFixture()
.I'm not sure whether this omission was intentional or accidental, I think the original intention was to use
getFixture()
to return these objects, but a change in theFixtureFactory
implementation means this no longer works.