Fixed AssertEntitiesEqual corrupting entities

This commit is contained in:
Marcin Kurczewski 2014-10-15 15:57:33 +02:00
parent 250ffb209f
commit 0d50550c43

View file

@ -67,11 +67,13 @@ abstract class AbstractTestCase extends \PHPUnit_Framework_TestCase
else else
{ {
$this->assertNotNull($actual[$key]); $this->assertNotNull($actual[$key]);
$expected[$key]->resetLazyLoaders(); $expectedEntity = clone($expected[$key]);
$expected[$key]->resetMeta(); $actualEntity = clone($actual[$key]);
$actual[$key]->resetLazyLoaders(); $expectedEntity->resetLazyLoaders();
$actual[$key]->resetMeta(); $expectedEntity->resetMeta();
$this->assertEquals($expected[$key], $actual[$key]); $actualEntity->resetLazyLoaders();
$actualEntity->resetMeta();
$this->assertEquals($expectedEntity, $actualEntity);
} }
} }
} }