From 2138c4bb55798d01f2341ebc3f0016b4ffc8684f Mon Sep 17 00:00:00 2001 From: Michael Date: Fri, 15 May 2020 15:30:43 +0000 Subject: [PATCH] Avoid "Invalid argument supplied for foreach()" --- tests/DatabaseTestTrait.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/DatabaseTestTrait.php b/tests/DatabaseTestTrait.php index 36636feabd..2b829e51ee 100644 --- a/tests/DatabaseTestTrait.php +++ b/tests/DatabaseTestTrait.php @@ -61,7 +61,11 @@ trait DatabaseTestTrait $data = include $fixture; foreach ($data as $tableName => $rows) { - if (!is_array($rows) && !is_numeric($tableName)) { + if (is_numeric($tableName)) { + continue; + } + + if (!is_array($rows)) { $dba->p('TRUNCATE TABLE `' . $tableName . '``'); continue; } -- 2.39.5