Skip to content

Commit

Permalink
fix: testLoadFixturesCheckReferences
Browse files Browse the repository at this point in the history
  • Loading branch information
alexislefebvre committed Nov 12, 2023
1 parent c13efc1 commit 52fc814
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions tests/Test/ConfigMysqlCacheDbTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,19 +119,28 @@ public function testLoadFixturesAndCheckBackup(): void
*/
public function testLoadFixturesCheckReferences(): void
{
$this->markTestSkipped('This test is broken right now.');
$referenceRepository = $this->databaseTool->loadFixtures([
'Liip\Acme\Tests\App\DataFixtures\ORM\LoadUserData',
])->getReferenceRepository();

$this->assertCount(1, $referenceRepository->getReferences());
$references = (method_exists($referenceRepository, 'getReferencesByClass'))
// with getReferencesByClass(), references are grouped by class
? $referenceRepository->getReferencesByClass()['Liip\Acme\Tests\App\Entity\User']
: $referenceRepository->getReferences();

$this->assertCount(1, $references);

$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'))
// with getReferencesByClass(), references are grouped by class
? $referenceRepository->getReferencesByClass()['Liip\Acme\Tests\App\Entity\User']
: $referenceRepository->getReferences();

$this->assertCount(2, $references);
}

protected static function getKernelClass(): string
Expand Down

0 comments on commit 52fc814

Please sign in to comment.