Permalink
Browse files

Properly using sort() before asserting values, asserting the result o…

…f sort() is cheating :P
  • Loading branch information...
1 parent 1eb55bc commit cf03b33a0dd260b97d60800ebf33a4995a997616 @lorenzo lorenzo committed Dec 10, 2011
Showing with 6 additions and 2 deletions.
  1. +6 −2 lib/Cake/Test/Case/Utility/FolderTest.php
@@ -436,7 +436,9 @@ public function testFolderTreeWithHiddenFiles() {
);
$result = $Folder->tree(null, false);
- $this->assertEquals(sort($expected), sort($result));
+ sort($result[1]);
+ sort($expected[1]);
+ $this->assertEquals($expected, $result);
$expected = array(
array(
@@ -451,7 +453,9 @@ public function testFolderTreeWithHiddenFiles() {
);
$result = $Folder->tree(null, true);
- $this->assertEquals(sort($expected), sort($result));
+ sort($result[1]);
+ sort($expected[1]);
+ $this->assertEquals($expected, $result);
$Folder->delete();
}

0 comments on commit cf03b33

Please sign in to comment.