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
{
$this->assertNotNull($actual[$key]);
$expected[$key]->resetLazyLoaders();
$expected[$key]->resetMeta();
$actual[$key]->resetLazyLoaders();
$actual[$key]->resetMeta();
$this->assertEquals($expected[$key], $actual[$key]);
$expectedEntity = clone($expected[$key]);
$actualEntity = clone($actual[$key]);
$expectedEntity->resetLazyLoaders();
$expectedEntity->resetMeta();
$actualEntity->resetLazyLoaders();
$actualEntity->resetMeta();
$this->assertEquals($expectedEntity, $actualEntity);
}
}
}