From 58743d7492234272d9a0cb14117415b461cd6e8b Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Fri, 10 Oct 2014 17:04:10 +0300 Subject: Fix Config_test::test_base_url() --- tests/codeigniter/core/Config_test.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'tests/codeigniter') 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; } // -------------------------------------------------------------------- -- cgit v1.2.3-24-g4f1b From 421133d06fd682e4672c5e73d65b836e5e62a57d Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Wed, 22 Oct 2014 23:29:03 +0300 Subject: [ci skip] Update 2 links to relate to bcit-ci/ --- tests/codeigniter/core/Security_test.php | 2 +- tests/codeigniter/core/URI_test.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'tests/codeigniter') 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('
Hello Booya
', $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() { -- cgit v1.2.3-24-g4f1b From 50c9ea154c125f5ce1a2d0384470f4e71188d628 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Fri, 7 Nov 2014 16:57:41 +0200 Subject: Fix #3317 ... MCrypt sucks --- tests/codeigniter/libraries/Encryption_test.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'tests/codeigniter') 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))); } -- cgit v1.2.3-24-g4f1b