From: Michael Date: Fri, 15 May 2020 15:30:43 +0000 (+0000) Subject: Avoid "Invalid argument supplied for foreach()" X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=2138c4bb55798d01f2341ebc3f0016b4ffc8684f;p=friendica.git Avoid "Invalid argument supplied for foreach()" --- 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; }