Skip to content

Commit dc04438

Browse files
fix: Fixed check on non-existant 'schema' array key.
1 parent 6cae124 commit dc04438

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/Testing/DatabaseTruncation.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,14 @@ protected function migrateFreshUsing()
3737

3838
return $results;
3939
}
40+
41+
/**
42+
* Determine if a table exists in the given list, with or without its schema.
43+
*/
44+
protected function tableExistsIn(array $table, array $tables): bool
45+
{
46+
return isset($table['schema'])
47+
? ! empty(array_intersect([$table['name'], $table['schema'] . '.' . $table['name']], $tables))
48+
: in_array($table['name'], $tables);
49+
}
4050
}

0 commit comments

Comments
 (0)