From 31bbc4db30ca92204d5e993a08302da7376fe37e Mon Sep 17 00:00:00 2001 From: Rajesh Taneja Date: Mon, 18 Jan 2016 13:56:18 +0800 Subject: [PATCH] MDL-52799 phpunit: Truncate records for brokedmysql not empty. --- lib/testing/classes/util.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/testing/classes/util.php b/lib/testing/classes/util.php index 1b08d6ff86a..7fadabbcf9e 100644 --- a/lib/testing/classes/util.php +++ b/lib/testing/classes/util.php @@ -638,7 +638,12 @@ abstract class testing_util { 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; }