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
-
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
- 38 Getting Started & Guidelines
- 7 Getting Started in the Community
- 8 Additional Resources
- 7 Community Ideas and Feedback
- 33 Spryker News
- 565 Developer Corner
- 435 Spryker Development
- 54 Spryker Dev Environment
- 296 Spryker Releases
- 30 Propel ORM
- 47 Community Projects
- 6 Gacela Project
- 3 PHP Bridge
- 21 Hackathon
- 3.2K 📜 Slack Archives
- 115 Academy
- 5 Business Users
- 370 Docker
- 551 Slack General
- 2K Help
- 75 Knowledge Sharing
- 6 Random
- 4 Code Testing
- 23 Product & Business Questions
- 46 Spryker Safari Questions
- 36 The Blackhole