From 0c62709a9c2d714cdfa91ed0538818c449c022ca Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Wed, 21 Mar 2012 11:33:50 +0100 Subject: [PATCH] Fix: save and restore value of $this->id --- test/phpunit/CategorieTest.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test/phpunit/CategorieTest.php b/test/phpunit/CategorieTest.php index b974e6f57a5..895fec50781 100755 --- a/test/phpunit/CategorieTest.php +++ b/test/phpunit/CategorieTest.php @@ -135,7 +135,8 @@ class CategorieTest extends PHPUnit_Framework_TestCase print __METHOD__." result=".$result."\n"; $this->assertGreaterThan(0, $result); - // Unset $this->id for good check test + // Save and unset $this->id for good check test + $saveid = $localobject->id; unset($localobject->id); // We check if exist @@ -147,6 +148,9 @@ class CategorieTest extends PHPUnit_Framework_TestCase $result=$localobject->create($user); print __METHOD__." result=".$result."\n"; $this->assertEquals(-4, $result); + + // Restore $this->id with save value + $localobject->id = $saveid; return $result;