diff options
author | Thomas Steur <tsteur@users.noreply.github.com> | 2019-12-31 05:19:21 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-12-31 05:19:21 +0300 |
commit | cdf8d6b2a02a4dd24e1f6b719d83cb38bddd79ef (patch) | |
tree | 34228908c7e2a7e6c0eb29b37bdec9642f2cdd19 | |
parent | 8f33c4d4490b92e77f2293adb4ba3df8e294cb50 (diff) |
fix some tests (#15331)
-rw-r--r-- | core/Tracker/Db/Mysqli.php | 3 | ||||
-rw-r--r-- | tests/PHPUnit/Integration/Tracker/DbTest.php | 4 |
2 files changed, 5 insertions, 2 deletions
diff --git a/core/Tracker/Db/Mysqli.php b/core/Tracker/Db/Mysqli.php index 00f3b1a012..b3501d6aee 100644 --- a/core/Tracker/Db/Mysqli.php +++ b/core/Tracker/Db/Mysqli.php @@ -223,6 +223,9 @@ class Mysqli extends Db if (self::$profiling && isset($timer)) { $this->recordQueryProfile($query, $timer); } + if ($row === null) { + $row = false; + } return $row; } catch (Exception $e) { throw new DbException("Error query: " . $e->getMessage()); diff --git a/tests/PHPUnit/Integration/Tracker/DbTest.php b/tests/PHPUnit/Integration/Tracker/DbTest.php index b72ffc5191..4d94d34f9c 100644 --- a/tests/PHPUnit/Integration/Tracker/DbTest.php +++ b/tests/PHPUnit/Integration/Tracker/DbTest.php @@ -111,7 +111,7 @@ class DbTest extends IntegrationTestCase { $db = Tracker::getDatabase(); $val = $db->fetchRow('SELECT option_value from `' . $this->tableName . '` where option_name = "foobar"'); - $this->assertNull($val); + $this->assertFalse($val); } public function test_fetch() @@ -128,7 +128,7 @@ class DbTest extends IntegrationTestCase { $db = Tracker::getDatabase(); $val = $db->fetch('SELECT option_value from `' . $this->tableName . '` where option_name = "foobar"'); - $this->assertNull($val); + $this->assertFalse($val); } public function test_fetchAll() |