Skip to content

Commit

Permalink
fix: rewrite testLoadFixturesCheckReferences
Browse files Browse the repository at this point in the history
  • Loading branch information
alexislefebvre committed Jul 3, 2024
1 parent 471d32e commit 29618c0
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions tests/Test/ConfigMysqlCacheDbTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,21 +112,31 @@ public function testLoadFixturesAndCheckBackup(): void
);
}

public function testLoadFixturesCheckReferences(): void
public function testLoadFixturesCheckReferencesByClass(): 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 = $referenceRepository->getReferencesByClass();

$className = 'Liip\Acme\Tests\App\Entity\User';

$this->assertArrayHasKey($className, $references);

$this->assertCount(1, $references[$className]);

$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 = $referenceRepository->getReferencesByClass();

$this->assertArrayHasKey($className, $references);

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

protected static function getKernelClass(): string
Expand Down

0 comments on commit 29618c0

Please sign in to comment.