liip / liip/LiipTestFixturesBundle
PDOException: There is no active transaction
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 178
- Forks
- 48
- PR merge metrics
- No merged PRs in 30d
Description
Hey,
When i try to load Fixtures, pdo throws the exception from above. I found a workaround using TransactionHelper from Doctrine, but therefore i have to edit the Doctrine EntityManager, and i don't think that this should be the way to go.
public function setUp(): void
{
parent::setUp();
$this->client = self::createClient([],[]);
$this->databaseTool = $this->getContainer()->get(DatabaseToolCollection::class)->get();
$this->executor = $this->databaseTool->loadFixtures($this->getFixtureClasses());
}
using this code, i get the following stacktrace:
- App\Tests\Controller\AppBundle\AnonymousRedirectCrawlTest::testAnonymousRedirected with data set #0 ('/', '/login')
PDOException: There is no active transaction
/var/www/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php:1854
/var/www/app/vendor/doctrine/orm/lib/Doctrine/ORM/EntityManager.php:253
/var/www/app/vendor/doctrine/data-fixtures/lib/Doctrine/Common/DataFixtures/Executor/ORMExecutor.php:76
/var/www/app/vendor/liip/test-fixtures-bundle/src/Services/DatabaseTools/ORMDatabaseTool.php:130
/var/www/app/tests/Setup/AbstractCrawlTest.php:70
I'm using PHP 8.1.7, PHPUnit 8.5.27,
liip/test-fixtures-bundle 2.4.0
Maybe you got a solution, on how to fix this Problem.
Ps. It's my first time, writing an Issue, so if sth. is missing, please tell me.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the fixture-loading failure from tests/Setup/AbstractCrawlTest.php:70 and trace the transaction handling through ORMDatabaseTool.php:130, ORMExecutor.php:76, and the EntityManager stack frame. Check the reported PHP, PHPUnit, and liip/test-fixtures-bundle versions. Done means fixture loading no longer raises “There is no active transaction” and the failure has a regression test.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php, symfony
- Domain
- database, testing
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100