1
0
Fork 0

Avoid "Invalid argument supplied for foreach()"

This commit is contained in:
Michael 2020-05-15 15:30:43 +00:00
parent 8868b7f8d9
commit 2138c4bb55

View file

@ -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;
}