Closed samdark closed 2 years ago
Could it be that fixtures are loaded too early?
Need a minimal test case in codeception/yii2-tests.
The hack of commenting out resetApplication()
in _after()
suggests that this code is called before the application is (re-)initialized.
Just wanted to make a note that it seems that it doesn't matter if you're trying to use MongoDB or MySQL/MariaDB. The problem triggers with both database systems.
I'm closing this due to its age. If it is still relevant in current versions feel free to create a new issue.
I still have this issue with:
"phpunit/phpunit": "^9.3",
"codeception/codeception": "^5.0",
"codeception/verify": "^2.2",
"codeception/module-asserts": "^3.0",
"codeception/module-yii2": "^1.1",
"codeception/module-phpbrowser": "^3.0",
"codeception/module-filesystem": "^3.0 || ^1.1"
The resetApplication comment hack works, but without it I get:
[yii\di\NotInstantiableException]
Failed to instantiate component or class "db".
Using the yii-starter-kit and trying to run tests with PHP 8 and Codeception 5. So far I can't find a definitive way to fix it.
Previously on PHP 7.4 and Codeception 2.4 and without codeception/module-yii2, run passed the tests.
free to create a new issue.
See https://github.com/yiisoft/yii2-app-advanced/issues/404
What are you trying to achieve?
Connect to MongoDB and apply fixtures.
What do you get instead?
Details
Culprit details: https://github.com/yiisoft/yii2-app-advanced/issues/404#issuecomment-488167386