Skip to content

Commit

Permalink
Add a test for issue bcit-ci#273
Browse files Browse the repository at this point in the history
  • Loading branch information
narfbg committed Oct 22, 2012
1 parent 9f6bdc0 commit 96a4ca6
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
16 changes: 16 additions & 0 deletions tests/codeigniter/database/query_builder/like_test.php
Expand Up @@ -87,4 +87,20 @@ public function test_or_not_like()
$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));
}

}
3 changes: 2 additions & 1 deletion tests/mocks/database/schema/skeleton.php
Expand Up @@ -129,7 +129,8 @@ public static function create_data()
),
'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')
)
);

Expand Down

0 comments on commit 96a4ca6

Please sign in to comment.