Browse Source

Merge pull request #13902 from othercorey/4.x-null-operator

4.x - Updated QueryExpression exception message when null is used
Mark Story 6 years ago
parent
commit
bd9599ab7a

+ 1 - 1
src/Database/Expression/QueryExpression.php

@@ -782,7 +782,7 @@ class QueryExpression implements ExpressionInterface, Countable
         }
 
         if ($value === null && $this->_conjunction !== ',') {
-            throw new InvalidArgumentException('Invalid or missing operator together with `null` usage.');
+            throw new InvalidArgumentException('Expression is missing operator (IS, IS NOT) with `null` value.');
         }
 
         return new Comparison($expression, $value, $type, $operator);

+ 1 - 1
tests/TestCase/Database/QueryTest.php

@@ -4119,7 +4119,7 @@ class QueryTest extends TestCase
     public function testIsNullInvalid()
     {
         $this->expectException(\InvalidArgumentException::class);
-        $this->expectExceptionMessage('Invalid or missing operator together with `null` usage.');
+        $this->expectExceptionMessage('Expression is missing operator (IS, IS NOT) with `null` value.');
 
         $this->loadFixtures('Authors');
         (new Query($this->connection))