Skip to content

Commit

Permalink
MDL-52799 phpunit: Truncate records for brokedmysql not empty.
Browse files Browse the repository at this point in the history
  • Loading branch information
Rajesh Taneja committed Jan 18, 2016
1 parent 6a01418 commit 31bbc4d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/testing/classes/util.php
Original file line number Diff line number Diff line change
Expand Up @@ -638,7 +638,12 @@ public static function reset_database() {

foreach ($data as $table => $records) {
if ($borkedmysql) {
if (empty($records) and isset($empties[$table])) {
if (empty($records)) {
if (isset($empties[$table])) {
// Table was not modified and is empty.
} else {
$DB->delete_records($table, null);
}
continue;
}

Expand Down

0 comments on commit 31bbc4d

Please sign in to comment.