summaryrefslogtreecommitdiffstats
path: root/tests/codeigniter
diff options
context:
space:
mode:
Diffstat (limited to 'tests/codeigniter')
-rw-r--r--tests/codeigniter/core/Loader_test.php1
-rw-r--r--tests/codeigniter/database/DB_driver_test.php2
-rw-r--r--tests/codeigniter/helpers/directory_helper_test.php8
-rw-r--r--tests/codeigniter/helpers/form_helper_test.php15
4 files changed, 20 insertions, 6 deletions
diff --git a/tests/codeigniter/core/Loader_test.php b/tests/codeigniter/core/Loader_test.php
index 816587a49..ecc5ca933 100644
--- a/tests/codeigniter/core/Loader_test.php
+++ b/tests/codeigniter/core/Loader_test.php
@@ -493,7 +493,6 @@ class Loader_test extends CI_TestCase {
);
$this->ci_vfs_create('autoload', '<?php $autoload = '.var_export($cfg, TRUE).';', $this->ci_app_root, 'config');
- // Run initialize and autoloader
$this->load->initialize();
// Verify path
diff --git a/tests/codeigniter/database/DB_driver_test.php b/tests/codeigniter/database/DB_driver_test.php
index 9e16e29b4..1f48ca984 100644
--- a/tests/codeigniter/database/DB_driver_test.php
+++ b/tests/codeigniter/database/DB_driver_test.php
@@ -5,7 +5,7 @@ class DB_driver_test extends CI_TestCase {
public function test_initialize()
{
$config = Mock_Database_DB::config(DB_DRIVER);
- $driver_name = current(explode('/', DB_DRIVER));
+ sscanf(DB_DRIVER, '%[^/]/', $driver_name);
$driver = $this->$driver_name($config[DB_DRIVER]);
$this->assertTrue($driver->initialize());
diff --git a/tests/codeigniter/helpers/directory_helper_test.php b/tests/codeigniter/helpers/directory_helper_test.php
index c39ccd8d0..41370e6e7 100644
--- a/tests/codeigniter/helpers/directory_helper_test.php
+++ b/tests/codeigniter/helpers/directory_helper_test.php
@@ -28,9 +28,9 @@ class Directory_helper_test extends CI_TestCase {
// test default recursive behavior
$expected = array(
- 'libraries' => array(
+ 'libraries/' => array(
'benchmark.html',
- 'database' => array('active_record.html', 'binds.html'),
+ 'database/' => array('active_record.html', 'binds.html'),
'email.html',
'0'
)
@@ -39,12 +39,12 @@ class Directory_helper_test extends CI_TestCase {
$this->assertEquals($expected, directory_map(vfsStream::url('testDir')));
// test detection of hidden files
- $expected['libraries'][] = '.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));
+ $this->assertEquals(array('libraries/'), directory_map(vfsStream::url('testDir'), 1));
}
}
diff --git a/tests/codeigniter/helpers/form_helper_test.php b/tests/codeigniter/helpers/form_helper_test.php
index 03278581d..89165271e 100644
--- a/tests/codeigniter/helpers/form_helper_test.php
+++ b/tests/codeigniter/helpers/form_helper_test.php
@@ -272,6 +272,21 @@ EOH;
$this->assertEquals($expected, form_close('</div></div>'));
}
+ // ------------------------------------------------------------------------
+
+ public function test_form_prep()
+ {
+ $this->assertEquals(
+ 'Here is a string containing &quot;quoted&quot; text.',
+ form_prep('Here is a string containing "quoted" text.')
+ );
+
+ $this->assertEquals(
+ 'Here is a string containing a &lt;tag&gt;.',
+ form_prep('Here is a string containing a <tag>.', TRUE)
+ );
+ }
+
}
/* End of file form_helper_test.php */ \ No newline at end of file