From 2fda8f7efc9429b551ce2bc14df0e2b0826b6170 Mon Sep 17 00:00:00 2001 From: John Bender Date: Wed, 29 Jun 2011 13:46:05 -0700 Subject: [PATCH] sorted directories to create consistent/readable order of execution --- tests/unit/ls.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/unit/ls.php b/tests/unit/ls.php index b311194c..6bcd1d72 100644 --- a/tests/unit/ls.php +++ b/tests/unit/ls.php @@ -1,17 +1,18 @@ array()); + $directories = array(); if ($handle = opendir(getcwd())) { while (false !== ($file = readdir($handle))) { if (is_dir($file) && $file[0] !== "." ) { - array_push($response['directories'], $file); + array_push($directories, $file); } } closedir($handle); } - echo json_encode($response) + sort($directories); + echo json_encode( array('directories' => $directories )); ?> \ No newline at end of file