liip / liip/LiipTestFixturesBundle

The identifier id is missing for a query of ...

Open
#71 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
PHP
Stars
178
Forks
48
PR merge metrics
No merged PRs in 30d

Description

Every thing was working great, until I enabled the cache_db configuration:

liip_test_fixtures:
    cache_db:
        sqlite: liip_test_fixtures.services_database_backup.sqlite

This is the stack trace of the exception I'm getting, any help would be appreciated:


1) App\Tests\Api\EmployeeTest::testExportCollection
Doctrine\ORM\ORMException: The identifier id is missing for a query of App\Entity\Evaluation\Employee
/builds/oppbtp/oppbtp_qcm_elec_api/vendor/doctrine/orm/lib/Doctrine/ORM/ORMException.php:309
/builds/oppbtp/oppbtp_qcm_elec_api/vendor/doctrine/orm/lib/Doctrine/ORM/EntityManager.php:488
/builds/oppbtp/oppbtp_qcm_elec_api/var/cache/test/ContainerWI1DfLB/EntityManager_9a5be93.php:142
/builds/oppbtp/oppbtp_qcm_elec_api/vendor/doctrine/data-fixtures/lib/Doctrine/Common/DataFixtures/ProxyReferenceRepository.php:82
/builds/oppbtp/oppbtp_qcm_elec_api/vendor/doctrine/data-fixtures/lib/Doctrine/Common/DataFixtures/ProxyReferenceRepository.php:115
/builds/oppbtp/oppbtp_qcm_elec_api/vendor/liip/test-fixtures-bundle/src/Services/DatabaseBackup/SqliteDatabaseBackup.php:68
/builds/oppbtp/oppbtp_qcm_elec_api/vendor/liip/test-fixtures-bundle/src/Services/DatabaseTools/ORMSqliteDatabaseTool.php:52
/builds/oppbtp/oppbtp_qcm_elec_api/vendor/liip/test-fixtures-bundle/src/Test/FixturesTrait.php:86
/builds/oppbtp/oppbtp_qcm_elec_api/src/Test/CustomApiTestCase.php:51

This a small vision about my dependencies:

doctrine/data-fixtures                       1.4.2   Data Fixtures for al...
doctrine/doctrine-fixtures-bundle            3.3.0   Symfony DoctrineFixt...
liip/test-fixtures-bundle                    1.7.0   This bundles enables.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce App\Tests\Api\EmployeeTest::testExportCollection with the shown cache_db SQLite configuration. Start with the stack-trace path through vendor/liip/test-fixtures-bundle/src/Services/DatabaseBackup/SqliteDatabaseBackup.php and the Doctrine fixture calls; done means the test no longer raises the missing Employee identifier exception when database caching is enabled.

Written by the indexing model from the issue text.

Assessment

Tech stack
php, sqlite, symfony
Domain
database, testing
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.