From 630bb85d9e25de94536c75a46eaf292c64b86a3c Mon Sep 17 00:00:00 2001 From: "Eloy Lafuente (stronk7)" Date: Wed, 12 Mar 2014 23:32:27 +0100 Subject: [PATCH] MDL-43266 testing: avoid assoc arrays for json Last commit switched from raw arrays to associative arrays. That leads to json_encode() to generate an object instead of an array, ultimately leading to problems with the rest of code expecting an array. By using array_values() we are moving back to the non-associative array. Also, fix some file permissions. --- lib/phpunit/classes/util.php | 0 lib/testing/classes/util.php | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) mode change 100755 => 100644 lib/phpunit/classes/util.php mode change 100755 => 100644 lib/testing/classes/util.php diff --git a/lib/phpunit/classes/util.php b/lib/phpunit/classes/util.php old mode 100755 new mode 100644 diff --git a/lib/testing/classes/util.php b/lib/testing/classes/util.php old mode 100755 new mode 100644 index 6848edca07a..ba4f4915170 --- a/lib/testing/classes/util.php +++ b/lib/testing/classes/util.php @@ -879,7 +879,7 @@ abstract class testing_util { // Save the file list in a JSON file. $fp = fopen($jsonfilepath, 'w'); - fwrite($fp, json_encode($listfiles)); + fwrite($fp, json_encode(array_values($listfiles))); fclose($fp); } }