Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: testLoadFixturesCheckReferences #244

Conversation

alexislefebvre
Copy link
Collaborator

@alexislefebvre alexislefebvre commented Nov 2, 2023

A test added in

had been broken in the last months.

This fix works but I can't explain why. 🤷

@alexislefebvre alexislefebvre force-pushed the fix-testLoadFixturesCheckReferences branch from a0e0f07 to 587c934 Compare November 2, 2023 20:12
@alexislefebvre
Copy link
Collaborator Author

alexislefebvre commented Nov 2, 2023

When the bundle uses the Liip\TestFixturesBundle\Services\DatabaseBackup\MysqlDatabaseBackup service, the cache of metadata lacks some data.

  • running testLoadFixturesCheckReferences only: ☑️
  • running the whole class ConfigMysqlCacheDbTest only: ❎

@alexislefebvre alexislefebvre force-pushed the fix-testLoadFixturesCheckReferences branch from 00a5a97 to 52fc814 Compare November 12, 2023 14:17

$referenceRepository = $this->databaseTool->loadFixtures([
'Liip\Acme\Tests\App\DataFixtures\ORM\LoadUserData',
'Liip\Acme\Tests\App\DataFixtures\ORM\LoadSecondUserData',
])->getReferenceRepository();

$this->assertCount(2, $referenceRepository->getReferences());
$references = (method_exists($referenceRepository, 'getReferencesByClass'))
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO: check that entities are loaded into database before checking the references.

@alexislefebvre
Copy link
Collaborator Author

Caches have been removed from 3.x:

@alexislefebvre alexislefebvre deleted the fix-testLoadFixturesCheckReferences branch March 11, 2024 21:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant