Codeception / Codeception/module-doctrine
loadFixtures() doesn't work with Symfony's dependency injection
- Dominant language
- PHP
- Stars
- 4
- Forks
- 2
- PR merge metrics
- No merged PRs in 30d
Description
When the fixture class is a Symfony service with normal dependency injection (i.e. constructor arguments), loading them with `$I->loadFixtures(AppFixtures::class)` leads to this error message:
> [ArgumentCountError] Too few arguments to function App\DataFixtures\AppFixtures::__construct(), 0 passed in /.../vendor/codeception/module-doctrine2/src/Codeception/Module/Doctrine2.php on line 731 and exactly 4 expected
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with loadFixtures() in Doctrine2.php around line 731, where the issue reports AppFixtures being constructed without arguments. Reproduce the failure using a Symfony fixture service with four constructor arguments. Done means loadFixtures(AppFixtures::class) loads the fixture without the ArgumentCountError and has coverage for constructor-injected fixtures.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- backend, database
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100