From 03bafe99fe982dbff7adc9e7ef04c55ec3a32fcb Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Thu, 19 Feb 2015 17:22:14 +0200 Subject: Revert last commit & just ignore E_DEPRECATED --- tests/codeigniter/database/DB_test.php | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'tests') diff --git a/tests/codeigniter/database/DB_test.php b/tests/codeigniter/database/DB_test.php index d5a9369e6..dc4fae986 100644 --- a/tests/codeigniter/database/DB_test.php +++ b/tests/codeigniter/database/DB_test.php @@ -26,6 +26,14 @@ class DB_test extends CI_TestCase { { $config = Mock_Database_DB::config(DB_DRIVER); $connection = new Mock_Database_DB($config); + + // E_DEPRECATED notices thrown by mysql_connect(), mysql_pconnect() + // on PHP 5.5+ cause the tests to fail + if (DB_DRIVER === 'mysql' && version_compare(PHP_VERSION, '5.5', '>=')) + { + error_reporting(E_ALL & ~E_DEPRECATED); + } + $db = Mock_Database_DB::DB($connection->set_dsn(DB_DRIVER), TRUE); $this->assertTrue($db instanceof CI_DB); -- cgit v1.2.3-24-g4f1b From b5925ec58a43b85bffb0d3aea6032f0b909b1121 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Thu, 26 Feb 2015 10:06:54 +0200 Subject: Fix .travis.yml for PHP7 and try to fix a DB test --- tests/codeigniter/database/DB_driver_test.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/codeigniter/database/DB_driver_test.php b/tests/codeigniter/database/DB_driver_test.php index c04c42b09..26416d3fc 100644 --- a/tests/codeigniter/database/DB_driver_test.php +++ b/tests/codeigniter/database/DB_driver_test.php @@ -6,7 +6,7 @@ class DB_driver_test extends CI_TestCase { { $config = Mock_Database_DB::config(DB_DRIVER); sscanf(DB_DRIVER, '%[^/]/', $driver_name); - $driver = $this->$driver_name($config[DB_DRIVER]); + $driver = $this->{$driver_name}($config[DB_DRIVER]); $this->assertTrue($driver->initialize()); } -- cgit v1.2.3-24-g4f1b From 52caf59f244e0c1363ac0ce6ba61a7f5001603df Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Fri, 27 Feb 2015 15:09:34 +0200 Subject: Make CI_Input:: read-only as well --- tests/mocks/core/input.php | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'tests') diff --git a/tests/mocks/core/input.php b/tests/mocks/core/input.php index 0d1873849..40e27441f 100644 --- a/tests/mocks/core/input.php +++ b/tests/mocks/core/input.php @@ -38,4 +38,12 @@ class Mock_Core_Input extends CI_Input { return FALSE; } + public function __set($name, $value) + { + if ($name === 'ip_address') + { + $this->ip_address = $value; + } + } + } \ No newline at end of file -- cgit v1.2.3-24-g4f1b From 4b25348e06a7587c64b97811208352c5c9478ab8 Mon Sep 17 00:00:00 2001 From: Heesung Ahn Date: Sun, 1 Mar 2015 23:21:44 -0500 Subject: test_strip_omage_tags Signed-off-by:Heesung Ahn --- tests/codeigniter/core/Security_test.php | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'tests') diff --git a/tests/codeigniter/core/Security_test.php b/tests/codeigniter/core/Security_test.php index d967613b5..bf1714622 100644 --- a/tests/codeigniter/core/Security_test.php +++ b/tests/codeigniter/core/Security_test.php @@ -126,5 +126,24 @@ class Security_test extends CI_TestCase { $this->assertEquals('foo', $safe_filename); } + + // -------------------------------------------------------------------- + public function test_strip_image_tags() + { + $imgtags = Array( + 'Smiley face', + '' + ); + + $urls = Array( + 'smiley.gif', + 'http://www.w3schools.com/images/w3schools_green.jpg' + ); + + for($i = 0; $i < count($imgtags); $i++) + { + $this->assertEquals($urls[$i], $this->security->strip_image_tags($imgtags[$i])); + } + } } \ No newline at end of file -- cgit v1.2.3-24-g4f1b From 588a0e3774d1397b9cd0b5f9d0ba2f4793243267 Mon Sep 17 00:00:00 2001 From: Heesung Ahn Date: Thu, 5 Mar 2015 11:03:48 -0500 Subject: adding more img tags Signed-off-by:Heesung Ahn --- tests/codeigniter/core/Security_test.php | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'tests') diff --git a/tests/codeigniter/core/Security_test.php b/tests/codeigniter/core/Security_test.php index bf1714622..c96eecf02 100644 --- a/tests/codeigniter/core/Security_test.php +++ b/tests/codeigniter/core/Security_test.php @@ -133,12 +133,24 @@ class Security_test extends CI_TestCase { { $imgtags = Array( 'Smiley face', - '' + 'Smiley face', + '', + '', + 'MD Logo', + '', + '', + '' ); $urls = Array( 'smiley.gif', - 'http://www.w3schools.com/images/w3schools_green.jpg' + 'smiley.gif', + 'http://www.w3schools.com/images/w3schools_green.jpg', + '/img/sunset.gif', + 'mdn-logo-sm.png', + '', + '', + '' ); for($i = 0; $i < count($imgtags); $i++) -- cgit v1.2.3-24-g4f1b