diff --git a/cake/tests/cases/libs/folder.test.php b/cake/tests/cases/libs/folder.test.php index 1dd8e8ff0..34fe46e0e 100644 --- a/cake/tests/cases/libs/folder.test.php +++ b/cake/tests/cases/libs/folder.test.php @@ -271,13 +271,16 @@ class FolderTest extends CakeTestCase { ); $result = $Folder->tree(TEST_CAKE_CORE_INCLUDE_PATH . 'config', false); - $this->assertEqual($result, $expected); + $this->assertIdentical(array_diff($expected[0], $result[0]), array()); + $this->assertIdentical(array_diff($result[0], $expected[0]), array()); $result = $Folder->tree(TEST_CAKE_CORE_INCLUDE_PATH . 'config', false, 'dir'); - $this->assertEqual($result, $expected[0]); + $this->assertIdentical(array_diff($expected[0], $result), array()); + $this->assertIdentical(array_diff($result, $expected[0]), array()); $result = $Folder->tree(TEST_CAKE_CORE_INCLUDE_PATH . 'config', false, 'files'); - $this->assertEqual($result, $expected[1]); + $this->assertIdentical(array_diff($expected[1], $result), array()); + $this->assertIdentical(array_diff($result, $expected[1]), array()); } /** * testWindowsPath method @@ -405,10 +408,20 @@ class FolderTest extends CakeTestCase { $Folder->cd(TEST_CAKE_CORE_INCLUDE_PATH . 'config'); $result = $Folder->find(); $expected = array('config.php', 'paths.php'); + $this->assertIdentical(array_diff($expected, $result), array()); + $this->assertIdentical(array_diff($result, $expected), array()); + + $result = $Folder->find('.*', true); + $expected = array('config.php', 'paths.php'); $this->assertIdentical($result, $expected); $result = $Folder->find('.*\.php'); $expected = array('config.php', 'paths.php'); + $this->assertIdentical(array_diff($expected, $result), array()); + $this->assertIdentical(array_diff($result, $expected), array()); + + $result = $Folder->find('.*\.php', true); + $expected = array('config.php', 'paths.php'); $this->assertIdentical($result, $expected); $result = $Folder->find('.*ig\.php'); @@ -450,6 +463,14 @@ class FolderTest extends CakeTestCase { TEST_CAKE_CORE_INCLUDE_PATH . 'config' . DS . 'config.php', TEST_CAKE_CORE_INCLUDE_PATH . 'config' . DS . 'paths.php' ); + $this->assertIdentical(array_diff($expected, $result), array()); + $this->assertIdentical(array_diff($result, $expected), array()); + + $result = $Folder->findRecursive('(config|paths)\.php', true); + $expected = array( + TEST_CAKE_CORE_INCLUDE_PATH . 'config' . DS . 'config.php', + TEST_CAKE_CORE_INCLUDE_PATH . 'config' . DS . 'paths.php' + ); $this->assertIdentical($result, $expected); $Folder->cd(TMP); @@ -472,6 +493,14 @@ class FolderTest extends CakeTestCase { TMP . 'testme' . DS . 'my.php', TMP . 'testme' . DS . 'paths.php' ); + $this->assertIdentical(array_diff($expected, $result), array()); + $this->assertIdentical(array_diff($result, $expected), array()); + + $result = $Folder->findRecursive('(paths|my)\.php', true); + $expected = array( + TMP . 'testme' . DS . 'my.php', + TMP . 'testme' . DS . 'paths.php' + ); $this->assertIdentical($result, $expected); $Folder->cd(TEST_CAKE_CORE_INCLUDE_PATH . 'config');