Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow store selection in CategoryBuilder, use default store root category for "top level categories" #44

Open
schmengler opened this issue May 12, 2020 · 0 comments

Comments

@schmengler
Copy link
Collaborator

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

topLevelCategoryInStore($storeId)

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

No branches or pull requests

1 participant