diff --git a/lib/Constants.php b/lib/Constants.php index 0648011..c24c1f3 100644 --- a/lib/Constants.php +++ b/lib/Constants.php @@ -39,8 +39,8 @@ \define('_BETWEEN', 'BETWEEN'); \define('_notBETWEEN', 'NOT BETWEEN'); - \define('_isNULL', 'IS NULL'); - \define('_notNULL', 'IS NOT NULL'); + \define('_isNULL', 'IS'); + \define('_notNULL', 'IS NOT'); \define('_BOOLEAN_OPERATORS', [ '<', '>', '=', '!=', '>=', '<=', '<>', 'IN', 'LIKE', 'NOT LIKE', 'BETWEEN', 'NOT BETWEEN', 'IS', 'IS NOT' diff --git a/lib/ezFunctions.php b/lib/ezFunctions.php index 5839664..bdc29c7 100644 --- a/lib/ezFunctions.php +++ b/lib/ezFunctions.php @@ -353,7 +353,7 @@ function gte($x, $y, $and = null, ...$args) * * @return array */ - function isNull($x, $y = 'null', $and = null, ...$args) + function isNull($x, $y = 'NULL', $and = null, ...$args) { $expression = array(); \array_push($expression, $x, \_isNULL, $y, $and, ...$args); @@ -370,7 +370,7 @@ function isNull($x, $y = 'null', $and = null, ...$args) * * @return array */ - function isNotNull($x, $y = 'null', $and = null, ...$args) + function isNotNull($x, $y = 'NULL', $and = null, ...$args) { $expression = array(); \array_push($expression, $x, \_notNULL, $y, $and, ...$args); diff --git a/tests/ezFunctionsTest.php b/tests/ezFunctionsTest.php index cf685cc..bee8b52 100644 --- a/tests/ezFunctionsTest.php +++ b/tests/ezFunctionsTest.php @@ -174,13 +174,13 @@ public function testGte() public function testIsNull() { $this->assertIsArray(isNull('field')); - $this->assertArraySubset([2 => 'null'], isNull('field')); + $this->assertArraySubset([2 => 'NULL'], isNull('field')); } public function testIsNotNull() { $this->assertIsArray(isNotNull('field')); - $this->assertArraySubset([2 => 'null'], isNotNull('field')); + $this->assertArraySubset([2 => 'NULL'], isNotNull('field')); } public function testLike()