From 9a33f7833729005e2ffd40dea9c10268b1bc0fbe Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Tue, 9 Feb 2016 23:37:59 +0200 Subject: [ci skip] Whitespace --- tests/codeigniter/core/Log_test.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/codeigniter/core/Log_test.php b/tests/codeigniter/core/Log_test.php index 01e90f5fc..d44cbac0f 100644 --- a/tests/codeigniter/core/Log_test.php +++ b/tests/codeigniter/core/Log_test.php @@ -17,7 +17,7 @@ class Log_test extends CI_TestCase { $enabled = new ReflectionProperty('CI_Log', '_enabled'); $enabled->setAccessible(TRUE); - $this->ci_set_config('log_path', '/root/'); + $this->ci_set_config('log_path', '/root/'); $this->ci_set_config('log_threshold', 'z'); $this->ci_set_config('log_date_format', 'd.m.Y'); $this->ci_set_config('log_file_extension', ''); -- cgit v1.2.3-24-g4f1b From c6011941511e706c3a3d44151eccda7d0b472007 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Thu, 11 Feb 2016 23:49:37 +0200 Subject: Fix #4449 --- .../database/query_builder/join_test.php | 27 ++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) (limited to 'tests') diff --git a/tests/codeigniter/database/query_builder/join_test.php b/tests/codeigniter/database/query_builder/join_test.php index 58cb21492..54b2a4e18 100644 --- a/tests/codeigniter/database/query_builder/join_test.php +++ b/tests/codeigniter/database/query_builder/join_test.php @@ -37,6 +37,29 @@ class Join_test extends CI_TestCase { // ------------------------------------------------------------------------ + public function test_join_escape_is_null() + { + $expected = 'SELECT '.$this->db->escape_identifiers('field') + ."\nFROM ".$this->db->escape_identifiers('table1') + ."\nJOIN ".$this->db->escape_identifiers('table2').' ON '.$this->db->escape_identifiers('field').' IS NULL'; + + $this->assertEquals( + $expected, + $this->db->select('field')->from('table1')->join('table2', 'field IS NULL')->get_compiled_select() + ); + + $expected = 'SELECT '.$this->db->escape_identifiers('field') + ."\nFROM ".$this->db->escape_identifiers('table1') + ."\nJOIN ".$this->db->escape_identifiers('table2').' ON '.$this->db->escape_identifiers('field').' IS NOT NULL'; + + $this->assertEquals( + $expected, + $this->db->select('field')->from('table1')->join('table2', 'field IS NOT NULL')->get_compiled_select() + ); + } + + // ------------------------------------------------------------------------ + public function test_join_escape_multiple_conditions() { // We just need a valid query produced, not one that makes sense @@ -65,11 +88,11 @@ class Join_test extends CI_TestCase { $expected = 'SELECT '.implode(', ', $fields) ."\nFROM ".$this->db->escape_identifiers('table1') ."\nRIGHT JOIN ".$this->db->escape_identifiers('table2').' ON '.implode(' = ', $fields) - .' AND ('.$fields[0]." = 'foo' OR ".$fields[1].' = 0)'; + .' AND ('.$fields[0]." = 'foo' OR ".$fields[1].' IS NULL)'; $result = $this->db->select('table1.field1, table2.field2') ->from('table1') - ->join('table2', "table1.field1 = table2.field2 AND (table1.field1 = 'foo' OR table2.field2 = 0)", 'RIGHT') + ->join('table2', "table1.field1 = table2.field2 AND (table1.field1 = 'foo' OR table2.field2 IS NULL)", 'RIGHT') ->get_compiled_select(); $this->assertEquals($expected, $result); -- cgit v1.2.3-24-g4f1b From 7730dbebab54e6533a30f93c43311039b89c5760 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Fri, 12 Feb 2016 00:09:23 +0200 Subject: Skip CI_Log tests on PHP 5.2 We still run those (with failures enabled) and that test breaks them --- tests/codeigniter/core/Log_test.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/codeigniter/core/Log_test.php b/tests/codeigniter/core/Log_test.php index d44cbac0f..2dd9d90d2 100644 --- a/tests/codeigniter/core/Log_test.php +++ b/tests/codeigniter/core/Log_test.php @@ -1,9 +1,13 @@ markTestSkipped("PHP 5.2 doesn't have ReflectionProperty::setAccessible() and can't run this test"); + } + $path = new ReflectionProperty('CI_Log', '_log_path'); $path->setAccessible(TRUE); $threshold = new ReflectionProperty('CI_Log', '_threshold'); @@ -50,6 +54,11 @@ class Log_test extends CI_TestCase { public function test_format_line() { + if ( ! is_php('5.3')) + { + return $this->markTestSkipped("PHP 5.2 doesn't have ReflectionProperty::setAccessible() and can't run this test"); + } + $this->ci_set_config('log_path', ''); $this->ci_set_config('log_threshold', 0); $instance = new CI_Log(); -- cgit v1.2.3-24-g4f1b From 3c0d8da56b8535bb3ab563256e221c81a4a96e4a Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Mon, 7 Mar 2016 10:52:15 +0200 Subject: Fix #4475 --- tests/codeigniter/core/Security_test.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'tests') diff --git a/tests/codeigniter/core/Security_test.php b/tests/codeigniter/core/Security_test.php index 2ef822863..8328c37cb 100644 --- a/tests/codeigniter/core/Security_test.php +++ b/tests/codeigniter/core/Security_test.php @@ -299,7 +299,8 @@ class Security_test extends CI_TestCase { 'MD Logo', '', '', - '' + '', + '' ); $urls = array( @@ -310,7 +311,8 @@ class Security_test extends CI_TestCase { 'mdn-logo-sm.png', '', '', - '' + '', + 'non-quoted.attribute' ); for ($i = 0; $i < count($imgtags); $i++) -- cgit v1.2.3-24-g4f1b