From 70faf593a6313f61e86d64d3f638328c28063859 Mon Sep 17 00:00:00 2001 From: "Igor V. Gulyaev" Date: Wed, 29 Aug 2012 09:58:38 +0400 Subject: [PATCH] * fix hstore key exist check --- main/Base/Hstore.class.php | 2 +- test/main/HstoreTest.class.php | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/main/Base/Hstore.class.php b/main/Base/Hstore.class.php index 84238beed2..f49440cf3e 100644 --- a/main/Base/Hstore.class.php +++ b/main/Base/Hstore.class.php @@ -85,7 +85,7 @@ public function drop($key) public function isExists($key) { - return isset($this->properties[$key]); + return key_exists($key, $this->properties); } /** diff --git a/test/main/HstoreTest.class.php b/test/main/HstoreTest.class.php index 8938d868a4..3b8226a4fa 100644 --- a/test/main/HstoreTest.class.php +++ b/test/main/HstoreTest.class.php @@ -16,11 +16,15 @@ public function testRun() $array = array( '1' => 'qqer', 'f' => 'qs34$9&)_@+#qer', + 'null' => null ); $test = Hstore::make($array); $test2= Hstore::create($test->toString()); $this->assertEquals($test->toString(), $test2->toString()); + + $this->assertTrue($test->isExists('null')); + $this->assertFalse($test->isExists('notExist')); } }