From e8ecbdc0ee5037ede2f8dd7a818a7053f0755fc5 Mon Sep 17 00:00:00 2001 From: Damien Date: Mon, 7 Feb 2022 22:14:18 +1300 Subject: [PATCH 1/3] Update Constants.php Update `_isNULL` and `_notNULL` constants to allow checks to run correctly --- lib/Constants.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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' From 741dc53593214475735d8c185452e7545213cec7 Mon Sep 17 00:00:00 2001 From: Damien Date: Mon, 7 Feb 2022 22:18:22 +1300 Subject: [PATCH 2/3] Update ezFunctions.php Uppercased right expression for type consistency specific to these methods in `isNull` and `isNotNull` --- lib/ezFunctions.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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); From e690998268aa4d30353898bf1965f74250b48bf2 Mon Sep 17 00:00:00 2001 From: Damien Date: Mon, 7 Feb 2022 22:24:42 +1300 Subject: [PATCH 3/3] Update ezFunctionsTest.php Fix tests --- tests/ezFunctionsTest.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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()