summaryrefslogtreecommitdiffstats
path: root/tests/codeigniter/helpers/directory_helper_test.php
diff options
context:
space:
mode:
authorEric Roberts <eric@cryode.com>2012-12-12 14:02:11 +0100
committerEric Roberts <eric@cryode.com>2012-12-12 14:02:11 +0100
commitb9e35f21e1c70b6aa67c47e9244ed83195abc00a (patch)
tree64f82db362deeac48cc20d1d1afd80651f36f5a5 /tests/codeigniter/helpers/directory_helper_test.php
parent0b05705c52c3bca7f9b3aee657c888e8ad1ff422 (diff)
parent545a7c86701875e1412bcde316e9bcc76d9a23a0 (diff)
Merge branch 'refs/heads/develop' into feature/form_error_msgs
Conflicts: system/language/english/form_validation_lang.php user_guide_src/source/libraries/form_validation.rst Signed-off-by: Eric Roberts <eric@cryode.com>
Diffstat (limited to 'tests/codeigniter/helpers/directory_helper_test.php')
-rw-r--r--tests/codeigniter/helpers/directory_helper_test.php49
1 files changed, 30 insertions, 19 deletions
diff --git a/tests/codeigniter/helpers/directory_helper_test.php b/tests/codeigniter/helpers/directory_helper_test.php
index 3937d2913..41370e6e7 100644
--- a/tests/codeigniter/helpers/directory_helper_test.php
+++ b/tests/codeigniter/helpers/directory_helper_test.php
@@ -1,41 +1,52 @@
<?php
class Directory_helper_test extends CI_TestCase {
-
+
public function set_up()
{
$this->helper('directory');
vfsStreamWrapper::register();
vfsStreamWrapper::setRoot(new vfsStreamDirectory('testDir'));
-
+
$this->_test_dir = vfsStreamWrapper::getRoot();
- }
-
+ }
+
public function test_directory_map()
{
- $structure = array('libraries' => array('benchmark.html' => '', 'database' =>
- array('active_record.html' => '', 'binds.html' => ''), 'email.html' => '', '.hiddenfile.txt' => ''));
-
+ $structure = array(
+ 'libraries' => array(
+ 'benchmark.html' => '',
+ 'database' => array('active_record.html' => '', 'binds.html' => ''),
+ 'email.html' => '',
+ '0' => '',
+ '.hiddenfile.txt' => ''
+ )
+ );
+
vfsStream::create($structure, $this->_test_dir);
// test default recursive behavior
- $expected = array('libraries' => array('benchmark.html', 'database' =>
- array('active_record.html', 'binds.html'), 'email.html'));
-
- $this->assertEquals($expected, directory_map(vfsStream::url('testDir')));
+ $expected = array(
+ 'libraries/' => array(
+ 'benchmark.html',
+ 'database/' => array('active_record.html', 'binds.html'),
+ 'email.html',
+ '0'
+ )
+ );
- // test recursion depth behavior
- $expected = array('libraries');
-
- $this->assertEquals($expected, directory_map(vfsStream::url('testDir'), 1));
+ $this->assertEquals($expected, directory_map(vfsStream::url('testDir')));
// test detection of hidden files
- $expected = array('libraries' => array('benchmark.html', 'database' =>
- array('active_record.html', 'binds.html'), 'email.html', '.hiddenfile.txt'));
-
+ $expected['libraries/'][] = '.hiddenfile.txt';
+
$this->assertEquals($expected, directory_map(vfsStream::url('testDir'), FALSE, TRUE));
- }
+
+ // test recursion depth behavior
+ $this->assertEquals(array('libraries/'), directory_map(vfsStream::url('testDir'), 1));
+ }
+
}
/* End of file directory_helper_test.php */ \ No newline at end of file