We currently use code like this in test cases where no "current store" is set:
/*
* A current store is needed to determine root category automatically
*/
/** @var Emulation $emulation */
$emulation = $this->objectManager->get(Emulation::class);
$emulation->startEnvironmentEmulation(1);
$this->categoryFixture = new CategoryFixture(
CategoryBuilder::topLevelCategory()->build()
);
$emulation->stopEnvironmentEmulation();
Since 0.10.0 the path for "top categories" is always set to "1/2" and category data saved in global scope, independent of the "current store" state, so it won't be necessary anymore.
It would be better to have more control over this, e.g. with a builder factory like
We currently use code like this in test cases where no "current store" is set:
Since 0.10.0 the path for "top categories" is always set to "1/2" and category data saved in global scope, independent of the "current store" state, so it won't be necessary anymore.
It would be better to have more control over this, e.g. with a builder factory like
topLevelCategoryInStore($storeId)