summaryrefslogtreecommitdiffstats
path: root/tests/codeigniter/database/query_builder
diff options
context:
space:
mode:
authorJonatas Miguel <jonatas.df.miguel@gmail.com>2012-10-24 19:30:36 +0200
committerJonatas Miguel <jonatas.df.miguel@gmail.com>2012-10-24 19:30:36 +0200
commitb51823dde5fbae508b8ebf99258d2f514a8bece8 (patch)
tree4db09a22f85e0ddf151c940cd3e6fbaa799b8513 /tests/codeigniter/database/query_builder
parenta53f402b78ad07fb0f6da19cff0c7bec3a09a4c0 (diff)
parenta7001e968a4791312391eb245ad84888893cda8f (diff)
Merge branch 'develop' of git://github.com/EllisLab/CodeIgniter into develop
Conflicts: user_guide_src/source/changelog.rst
Diffstat (limited to 'tests/codeigniter/database/query_builder')
-rw-r--r--tests/codeigniter/database/query_builder/escape_test.php4
-rw-r--r--tests/codeigniter/database/query_builder/insert_test.php2
-rw-r--r--tests/codeigniter/database/query_builder/like_test.php16
3 files changed, 19 insertions, 3 deletions
diff --git a/tests/codeigniter/database/query_builder/escape_test.php b/tests/codeigniter/database/query_builder/escape_test.php
index c6380ddf1..27e678f22 100644
--- a/tests/codeigniter/database/query_builder/escape_test.php
+++ b/tests/codeigniter/database/query_builder/escape_test.php
@@ -27,7 +27,7 @@ class Escape_test extends CI_TestCase {
if (strpos(DB_DRIVER, 'mysql') !== FALSE)
{
- $sql = "SELECT `value` FROM `misc` WHERE `key` LIKE '$string%' ESCAPE '';";
+ $sql = "SELECT `value` FROM `misc` WHERE `key` LIKE '$string%' ESCAPE '!';";
}
else
{
@@ -52,7 +52,7 @@ class Escape_test extends CI_TestCase {
if (strpos(DB_DRIVER, 'mysql') !== FALSE)
{
- $sql = "SELECT `value` FROM `misc` WHERE `key` LIKE '$string%' ESCAPE '';";
+ $sql = "SELECT `value` FROM `misc` WHERE `key` LIKE '$string%' ESCAPE '!';";
}
else
{
diff --git a/tests/codeigniter/database/query_builder/insert_test.php b/tests/codeigniter/database/query_builder/insert_test.php
index a9aafb66e..30c055680 100644
--- a/tests/codeigniter/database/query_builder/insert_test.php
+++ b/tests/codeigniter/database/query_builder/insert_test.php
@@ -52,7 +52,7 @@ class Insert_test extends CI_TestCase {
// Do insert batch except for sqlite driver
if (strpos(DB_DRIVER, 'sqlite') === FALSE)
{
- $this->assertTrue($this->db->insert_batch('job', $job_datas));
+ $this->assertEquals(2, $this->db->insert_batch('job', $job_datas));
$job_2 = $this->db->where('id', 2)->get('job')->row();
$job_3 = $this->db->where('id', 3)->get('job')->row();
diff --git a/tests/codeigniter/database/query_builder/like_test.php b/tests/codeigniter/database/query_builder/like_test.php
index 5f3e52228..2736fbe0b 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('value', ' ')->get('misc')->result_array();
+ $tabs = $this->db->like('value', "\t")->get('misc')->result_array();
+
+ $this->assertEquals(1, count($spaces));
+ $this->assertEquals(1, count($tabs));
+ }
+
} \ No newline at end of file