diff options
-rw-r--r-- | tests/codeigniter/database/query_builder/like_test.php | 16 | ||||
-rw-r--r-- | tests/mocks/database/schema/skeleton.php | 3 |
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') ) ); |