diff --git a/src/Bundle/ChillMainBundle/Test/Export/AbstractAggregatorTest.php b/src/Bundle/ChillMainBundle/Test/Export/AbstractAggregatorTest.php index 4069a75b0..2012cd0eb 100644 --- a/src/Bundle/ChillMainBundle/Test/Export/AbstractAggregatorTest.php +++ b/src/Bundle/ChillMainBundle/Test/Export/AbstractAggregatorTest.php @@ -289,7 +289,6 @@ abstract class AbstractAggregatorTest extends KernelTestCase public function testDataNormalization(array $data, int $version, array $customAssert): void { $aggregator = $this->getAggregator(); - $em = $this->getContainer()->get(EntityManagerInterface::class); $normalized = $aggregator->normalizeFormData($data); $actual = $aggregator->denormalizeFormData($normalized, $version); @@ -300,7 +299,7 @@ abstract class AbstractAggregatorTest extends KernelTestCase self::assertArrayHasKey($key, $actual); if (array_key_exists($key, $customAssert)) { call_user_func($customAssert[$key], $actual[$key], $value); - } elseif ($em->contains($value)) { + } elseif (is_object($value) && method_exists($value, 'getId')) { self::assertEquals($value->getId(), $actual[$key]->getId()); } else { self::assertEquals($value, $actual[$key]); diff --git a/src/Bundle/ChillMainBundle/Test/Export/AbstractFilterTest.php b/src/Bundle/ChillMainBundle/Test/Export/AbstractFilterTest.php index 5fd638a1e..f004688b7 100644 --- a/src/Bundle/ChillMainBundle/Test/Export/AbstractFilterTest.php +++ b/src/Bundle/ChillMainBundle/Test/Export/AbstractFilterTest.php @@ -163,7 +163,7 @@ abstract class AbstractFilterTest extends KernelTestCase self::assertArrayHasKey($key, $actual); if (array_key_exists($key, $customAssert)) { call_user_func($customAssert[$key], $actual[$key], $value); - } elseif ($em->contains($value)) { + } elseif (is_object($value) && method_exists($value, 'getId')) { self::assertEquals($value->getId(), $actual[$key]->getId()); } else { self::assertEquals($value, $actual[$key]);