summaryrefslogtreecommitdiffstats
path: root/tests/codeigniter/helpers/directory_helper_test.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/codeigniter/helpers/directory_helper_test.php')
-rw-r--r--tests/codeigniter/helpers/directory_helper_test.php59
1 files changed, 0 insertions, 59 deletions
diff --git a/tests/codeigniter/helpers/directory_helper_test.php b/tests/codeigniter/helpers/directory_helper_test.php
deleted file mode 100644
index 253c1e368..000000000
--- a/tests/codeigniter/helpers/directory_helper_test.php
+++ /dev/null
@@ -1,59 +0,0 @@
-<?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()
- {
- $ds = DIRECTORY_SEPARATOR;
-
- $structure = array(
- 'libraries' => array(
- 'benchmark.html' => '',
- 'database' => array('active_record.html' => '', 'binds.html' => ''),
- 'email.html' => '',
- '0' => '',
- '.hiddenfile.txt' => ''
- )
- );
-
- vfsStream::create($structure, $this->_test_dir);
-
- // is_dir(), opendir(), etc. seem to fail on Windows + vfsStream when there are trailing backslashes in directory names
- if ( ! is_dir(vfsStream::url('testDir').DIRECTORY_SEPARATOR))
- {
- $this->markTestSkipped("Can't test this under Windows");
- return;
- }
-
- // test default recursive behavior
- $expected = array(
- 'libraries'.$ds => array(
- 'benchmark.html',
- 'database'.$ds => array('active_record.html', 'binds.html'),
- 'email.html',
- '0'
- )
- );
-
- $this->assertEquals($expected, directory_map(vfsStream::url('testDir')));
-
- // test detection of hidden files
- $expected['libraries'.$ds][] = '.hiddenfile.txt';
-
- $this->assertEquals($expected, directory_map(vfsStream::url('testDir'), 0, TRUE));
-
- // test recursion depth behavior
- $this->assertEquals(array('libraries'.$ds), directory_map(vfsStream::url('testDir'), 1));
- }
-
-}