From 55f5f873327b6950f4258d10baf9f779192e717d Mon Sep 17 00:00:00 2001 From: bermiferrer Date: Mon, 24 Sep 2007 14:08:45 +0000 Subject: [PATCH] Adding unit test for recurse usage of Ak::dir git-svn-id: http://svn.akelos.org/trunk@371 a2fa5c27-f921-0410-a72c-bf682d381be0 --- test/unit/lib/utils/_Ak_file_functions.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/test/unit/lib/utils/_Ak_file_functions.php b/test/unit/lib/utils/_Ak_file_functions.php index 46d7aa6..8ee43b0 100755 --- a/test/unit/lib/utils/_Ak_file_functions.php +++ b/test/unit/lib/utils/_Ak_file_functions.php @@ -116,6 +116,15 @@ class test_of_Ak_file_functions extends UnitTestCase $this->assertEqual(Ak::file_get_contents(AK_LIB_DIR.DS.'AkActiveRecord.php'), file_get_contents(AK_LIB_DIR.DS.'AkActiveRecord.php')); } + function test_dir_should_not_recurse_when_set_to_false() + { + $files_and_dirs = Ak::dir(AK_LIB_DIR.DS.'AkActionView', array('dirs' => true, 'recurse' => false)); + foreach ($files_and_dirs as $k=>$file_or_dir){ + if(is_array($file_or_dir)){ + $this->assertEqual(count($files_and_dirs[$k]), 1); + } + } + } } ak_test('test_of_Ak_file_functions'); -- 2.11.4.GIT