Skip to content

Commit 7405177

Browse files
committed
Merge pull request #130 from crazedr0m/1.0
* fix hstore key exist check
2 parents 8539e28 + 70faf59 commit 7405177

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

main/Base/Hstore.class.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ public function drop($key)
8585

8686
public function isExists($key)
8787
{
88-
return isset($this->properties[$key]);
88+
return key_exists($key, $this->properties);
8989
}
9090

9191
/**

test/main/HstoreTest.class.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,15 @@ public function testRun()
1616
$array = array(
1717
'1' => 'qqer',
1818
'f' => 'qs34$9&)_@+#qer',
19+
'null' => null
1920
);
2021

2122
$test = Hstore::make($array);
2223
$test2= Hstore::create($test->toString());
2324

2425
$this->assertEquals($test->toString(), $test2->toString());
26+
27+
$this->assertTrue($test->isExists('null'));
28+
$this->assertFalse($test->isExists('notExist'));
2529
}
2630
}

0 commit comments

Comments
 (0)