From 0d50550c43db45e2fc5590e80fb23e615b96855e Mon Sep 17 00:00:00 2001 From: Marcin Kurczewski Date: Wed, 15 Oct 2014 15:57:33 +0200 Subject: [PATCH] Fixed AssertEntitiesEqual corrupting entities --- tests/AbstractTestCase.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/tests/AbstractTestCase.php b/tests/AbstractTestCase.php index 2d8fc7c6..461d776b 100644 --- a/tests/AbstractTestCase.php +++ b/tests/AbstractTestCase.php @@ -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); } } }