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 efdfcc4 commit c3960ad
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions tests/Test/ConfigMysqlCacheDbTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,21 +110,32 @@ 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 c3960ad

Please sign in to comment.