Avoid "Invalid argument supplied for foreach()"
This commit is contained in:
parent
8868b7f8d9
commit
2138c4bb55
|
@ -61,7 +61,11 @@ trait DatabaseTestTrait
|
||||||
$data = include $fixture;
|
$data = include $fixture;
|
||||||
|
|
||||||
foreach ($data as $tableName => $rows) {
|
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 . '``');
|
$dba->p('TRUNCATE TABLE `' . $tableName . '``');
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user