summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorAndrey Andreev <narf@bofh.bg>2012-10-23 00:11:48 +0200
committerAndrey Andreev <narf@bofh.bg>2012-10-23 00:11:48 +0200
commit96a4ca6605d6a8a94eea96ed00ab1cf31a8cdd35 (patch)
treea408fb4795fb7bd349fef8649eab616a3a826238 /tests
parent9f6bdc0b1b9f56997527652a0e1d09a9b233d32e (diff)
Add a test for issue #273
Diffstat (limited to 'tests')
-rw-r--r--tests/codeigniter/database/query_builder/like_test.php16
-rw-r--r--tests/mocks/database/schema/skeleton.php3
2 files changed, 18 insertions, 1 deletions
diff --git a/tests/codeigniter/database/query_builder/like_test.php b/tests/codeigniter/database/query_builder/like_test.php
index 5f3e52228..20ce5d99c 100644
--- a/tests/codeigniter/database/query_builder/like_test.php
+++ b/tests/codeigniter/database/query_builder/like_test.php
@@ -87,4 +87,20 @@ class Like_test extends CI_TestCase {
$this->assertEquals('Musician', $jobs[2]['name']);
}
+ // ------------------------------------------------------------------------
+
+ /**
+ * GitHub issue #273
+ *
+ * @see ./mocks/schema/skeleton.php
+ */
+ public function test_like_spaces_and_tabs()
+ {
+ $spaces = $this->db->like('key', ' ')->get('misc')->result_array();
+ $tabs = $this->db->like('key', "\t")->get('misc')->result_array();
+
+ $this->assertEquals(1, count($spaces));
+ $this->assertEquals(1, count($tabs));
+ }
+
} \ No newline at end of file
diff --git a/tests/mocks/database/schema/skeleton.php b/tests/mocks/database/schema/skeleton.php
index 18e1ddd4d..fb9aaefee 100644
--- a/tests/mocks/database/schema/skeleton.php
+++ b/tests/mocks/database/schema/skeleton.php
@@ -129,7 +129,8 @@ class Mock_Database_Schema_Skeleton {
),
'misc' => array(
array('id' => 1, 'key' => '\\xxxfoo456', 'value' => 'Entry with \\xxx'),
- array('id' => 2, 'key' => '\\%foo456', 'value' => 'Entry with \\%')
+ array('id' => 2, 'key' => '\\%foo456', 'value' => 'Entry with \\%'),
+ array('id' => 3, 'key' => ' One two three tab')
)
);