What are the Slack Archives?
Itβs a history of our time together in the Slack Community! Thereβs a ton of knowledge in here, so feel free to search through the archives for a possible answer to your question.
Because this space is not active, you wonβt be able to create a new post or comment here. If you have a question or want to start a discussion about something, head over to our categories and pick one to post in! You can always refer back to a post from Slack Archives if needed; just copy the link to use it as a reference..
I'm trying to use `SprykerTest\Shared\Sales\Helper\SalesDataHelper->haveOrderFromQuote()` to crea
I'm trying to use SprykerTest\Shared\Sales\Helper\SalesDataHelper->haveOrderFromQuote()
to create a test order. Seems to work basically, but I'm running into issues when using custom pre save plugins.
In Pyz\Zed\Sales\SalesDependencyProvider->getOrderItemExpanderPreSavePlugins()
there is a plugin which is located in a different module (ProductAttribute). The plugin itself is calling a function from its module's facade, of course.
When executing the test, it dies telling me that the facade function doesn't exist. This is because the test uses the ProductAttributeFacade from core, not the one on project level.
Any idea what's going wrong here?
Comments
-
\SprykerTest\Shared\Sales\Helper\SalesDataHelper::getSalesFacade()
check if your plugin uses locator to get ProductAttributeFacade
return $this->getLocator()->productAttribute()->facade();
0 -
The plugin doesn't have a getLocator function. Only the auto-generated function getFacade.
/** * @method ProductAttributeFacadeInterface getFacade() */
0 -
I see, maybe the resolver works in a wrong way in the tests env
\SprykerTest\Shared\Testify\Helper\LocatorHelper::getFacade()
0 -
Might be.
The main point is, that I'm not resolving this facade directly in my test.
In my test I'm using the SalesFacade only. The sales save order stack will then use a plugin which is located in the ProductAttribute module.
I can tell that we're having the SalesFacade on core level only, but the ProductAttributeFacade on project level.0 -
Have you defined the project namespaces for tests?
in
codeception.yml
where you add the helpers, you can configure the locator in the following way:suites: Presentation: ... modules: enabled: ... - \SprykerTest\Shared\Testify\Helper\LocatorHelper: projectNamespaces: ['Pyz']
0 -
Yes, I did.
0
Categories
- All Categories
- 42 Getting Started & Guidelines
- 7 Getting Started in the Community
- 8 Additional Resources
- 7 Community Ideas and Feedback
- 76 Spryker News
- 929 Developer Corner
- 787 Spryker Development
- 89 Spryker Dev Environment
- 362 Spryker Releases
- 3 Oryx frontend framework
- 35 Propel ORM
- 68 Community Projects
- 3 Community Ideation Board
- 30 Hackathon
- 3 PHP Bridge
- 6 Gacela Project
- 26 Job Opportunities
- 3.2K π Slack Archives
- 116 Academy
- 5 Business Users
- 370 Docker
- 551 Slack General
- 2K Help
- 75 Knowledge Sharing
- 6 Random Stuff
- 4 Code Testing
- 32 Product & Business Questions
- 70 Spryker Safari Questions
- 50 Random