summaryrefslogtreecommitdiffstats
path: root/tests/codeigniter
diff options
context:
space:
mode:
Diffstat (limited to 'tests/codeigniter')
-rw-r--r--tests/codeigniter/core/Config_test.php11
-rw-r--r--tests/codeigniter/core/Security_test.php2
-rw-r--r--tests/codeigniter/core/URI_test.php2
-rw-r--r--tests/codeigniter/libraries/Encryption_test.php7
4 files changed, 14 insertions, 8 deletions
diff --git a/tests/codeigniter/core/Config_test.php b/tests/codeigniter/core/Config_test.php
index 2c28a639c..8e312e361 100644
--- a/tests/codeigniter/core/Config_test.php
+++ b/tests/codeigniter/core/Config_test.php
@@ -76,7 +76,8 @@ class Config_test extends CI_TestCase {
// Capture server vars
$old_host = isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : NULL;
- $old_script = isset($_SERVER['SCRIPT_NAME']) ? $_SERVER['SCRIPT_NAME'] : NULL;
+ $old_script_name = isset($_SERVER['SCRIPT_NAME']) ? $_SERVER['SCRIPT_NAME'] : NULL;
+ $old_script_filename = $_SERVER['SCRIPT_FILENAME'];
$old_https = isset($_SERVER['HTTPS']) ? $_SERVER['HTTPS'] : NULL;
// Setup server vars for detection
@@ -85,6 +86,7 @@ class Config_test extends CI_TestCase {
$script = 'base_test.php';
$_SERVER['HTTP_HOST'] = $host;
$_SERVER['SCRIPT_NAME'] = $path.$script;
+ $_SERVER['SCRIPT_FILENAME'] = '/foo/bar/'.$script;
// Rerun constructor
$this->config = new $cls;
@@ -95,6 +97,7 @@ class Config_test extends CI_TestCase {
// Rerun constructor
$path = '/path/';
$_SERVER['SCRIPT_NAME'] = $path.$script;
+ $_SERVER['SCRIPT_FILENAME'] = '/foo/bar/'.$path.$script;
$this->config = new $cls;
// Test plain detected (subfolder)
@@ -110,10 +113,12 @@ class Config_test extends CI_TestCase {
// Restore server vars
if ($old_host === NULL) unset($_SERVER['HTTP_HOST']);
else $_SERVER['HTTP_HOST'] = $old_host;
- if ($old_script === NULL) unset($_SERVER['SCRIPT_NAME']);
- else $_SERVER['SCRIPT_NAME'] = $old_script;
+ if ($old_script_name === NULL) unset($_SERVER['SCRIPT_NAME']);
+ else $_SERVER['SCRIPT_NAME'] = $old_script_name;
if ($old_https === NULL) unset($_SERVER['HTTPS']);
else $_SERVER['HTTPS'] = $old_https;
+
+ $_SERVER['SCRIPT_FILENAME'] = $old_script_filename;
}
// --------------------------------------------------------------------
diff --git a/tests/codeigniter/core/Security_test.php b/tests/codeigniter/core/Security_test.php
index c80c3d65a..402422ff8 100644
--- a/tests/codeigniter/core/Security_test.php
+++ b/tests/codeigniter/core/Security_test.php
@@ -98,7 +98,7 @@ class Security_test extends CI_TestCase {
$this->assertEquals('<div>Hello <b>Booya</b></div>', $decoded);
- // Issue #3057 (https://github.com/EllisLab/CodeIgniter/issues/3057)
+ // Issue #3057 (https://github.com/bcit-ci/CodeIgniter/issues/3057)
$this->assertEquals(
'&foo should not include a semicolon',
$this->security->entity_decode('&foo should not include a semicolon')
diff --git a/tests/codeigniter/core/URI_test.php b/tests/codeigniter/core/URI_test.php
index 6589c1f5a..b05a385d6 100644
--- a/tests/codeigniter/core/URI_test.php
+++ b/tests/codeigniter/core/URI_test.php
@@ -11,7 +11,7 @@ class URI_test extends CI_TestCase {
/* As of the following commit, _set_uri_string() is a protected method:
- https://github.com/EllisLab/CodeIgniter/commit/d461934184d95b0cfb2feec93f27b621ef72a5c2
+ https://github.com/bcit-ci/CodeIgniter/commit/d461934184d95b0cfb2feec93f27b621ef72a5c2
public function test_set_uri_string()
{
diff --git a/tests/codeigniter/libraries/Encryption_test.php b/tests/codeigniter/libraries/Encryption_test.php
index f457fe325..cbcae3133 100644
--- a/tests/codeigniter/libraries/Encryption_test.php
+++ b/tests/codeigniter/libraries/Encryption_test.php
@@ -155,15 +155,16 @@ class Encryption_test extends CI_TestCase {
);
$output = $this->encryption->__get_params($params);
- unset($output['handle'], $params['raw_data']);
+ unset($output['handle'], $output['cipher'], $params['raw_data'], $params['cipher']);
$params['base64'] = FALSE;
$this->assertEquals($params, $output);
// HMAC disabled
unset($params['hmac_key'], $params['hmac_digest']);
$params['hmac'] = $params['raw_data'] = FALSE;
+ $params['cipher'] = 'aes-128';
$output = $this->encryption->__get_params($params);
- unset($output['handle'], $params['hmac'], $params['raw_data']);
+ unset($output['handle'], $output['cipher'], $params['hmac'], $params['raw_data'], $params['cipher']);
$params['base64'] = TRUE;
$params['hmac_digest'] = $params['hmac_key'] = NULL;
$this->assertEquals($params, $output);
@@ -195,7 +196,7 @@ class Encryption_test extends CI_TestCase {
$this->assertEquals($message, $this->encryption->decrypt($this->encryption->encrypt($message)));
// Try DES in ECB mode, just for the sake of changing stuff
- $this->encryption->initialize(array('cipher' => 'des', 'mode' => 'ecb'));
+ $this->encryption->initialize(array('cipher' => 'des', 'mode' => 'ecb', 'key' => substr($key, 0, 8)));
$this->assertEquals($message, $this->encryption->decrypt($this->encryption->encrypt($message)));
}