Skip to content

Commit

Permalink
Yaml tests have curious definitions for 'truthy' and 'falsey
Browse files Browse the repository at this point in the history
Set an explicit list so that there are no confusions
  • Loading branch information
polyfractal committed Jan 20, 2014
1 parent 6738578 commit 67b29d3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/Elasticsearch/Tests/YamlRunnerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ private function assertTruthy($value)
{
echo "\n |assertTruthy: ".json_encode($value)."\n";
ob_flush();
if (!$value) {
if (isset($value) === false || $value === 0 || $value === false || $value === null || $value === '') {
$this->fail("Value is not truthy: ".print_r($value, true));
}
}
Expand All @@ -123,7 +123,7 @@ private function assertFalsey($value)
{
echo "\n |assertFalsey: ".json_encode($value)."\n";
ob_flush();
if ($value) {
if (!(isset($value) === false || $value === 0 || $value === false || $value === null || $value === '')) {
$this->fail("Value is not falsey: ".print_r($value, true));
}
}
Expand Down

0 comments on commit 67b29d3

Please sign in to comment.