Global Dependency Provider is not used in tests
Hi,
We moved some dependencies to a Global Dependency Provider as documented by spryker here
. This works fine. But when exeucting tests codeception does not recognize the dependencies registered in the Global Dependency Provider.The first assumption was that it just needs to be registered in yet another Class which uses 'getApplicationPlugins' to register those but unfortunately there is no option provided for codeception.
Currently our solution is to customize the "src/Pyz/Shared/Kernel/ContainerMocker/ContainerMocker.php" trait and manually add the Global Dependency Provider by then also customizing every single Class that uses this trait. This works, but obviously isn't ideal. There should be an option to make codeception aware of Global Dependencies in a single central location.
Has anybody else encountered this problem and has a more efficient solution or did we overlook something?
Answers
-
fsmeier Senior Software Engineer & Developer Enablement Advocate Sprykee Posts: 1,057 ⚖️ - Guardians (admin)
Heyhey @shas ,
I have some questions to understand the challenge a bit better:
- Where did you register your
ApplicationPlugin
? - What kind of test are you trying to write?
Because without a full boot of your targeted Application no ApplicationPlugin should be loaded at all.
Maybe you can show me your codeception.yml
All the best,
Florian
0 - Where did you register your
Categories
- All Categories
- 42 Getting Started & Guidelines
- 7 Getting Started in the Community
- 8 Additional Resources
- 7 Community Ideas and Feedback
- 69 Spryker News
- 899 Developer Corner
- 760 Spryker Development
- 83 Spryker Dev Environment
- 361 Spryker Releases
- 3 Oryx frontend framework
- 34 Propel ORM
- 68 Community Projects
- 3 Community Ideation Board
- 30 Hackathon
- 3 PHP Bridge
- 6 Gacela Project
- 24 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
- 68 Spryker Safari Questions
- 50 Random