diff options
author | Robin Appelman <icewind@owncloud.com> | 2014-09-09 13:57:02 +0200 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2014-09-16 15:32:34 +0200 |
commit | 1771bfc2f2c790bc5d7a439095290cb4c97edf1a (patch) | |
tree | 85d26a01433af40d1aa7b3a39c22b51053a91f1e /tests/lib | |
parent | 1978d3d6a279a4c60371b2cf809bd57e70f4ed35 (diff) | |
download | nextcloud-server-1771bfc2f2c790bc5d7a439095290cb4c97edf1a.tar.gz nextcloud-server-1771bfc2f2c790bc5d7a439095290cb4c97edf1a.zip |
Introduce cross-db ILIKE
Diffstat (limited to 'tests/lib')
-rw-r--r-- | tests/lib/db.php | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/lib/db.php b/tests/lib/db.php index 1f62413cbe4..893d42cdbe9 100644 --- a/tests/lib/db.php +++ b/tests/lib/db.php @@ -263,4 +263,19 @@ class Test_DB extends PHPUnit_Framework_TestCase { $query = OC_DB::prepare("UPDATE `*PREFIX*{$this->table2}` SET `uri` = ? WHERE `fullname` = ?"); return $query->execute(array($uri, $fullname)); } + + public function testILIKE() { + $table = "*PREFIX*{$this->table2}"; + + $query = OC_DB::prepare("INSERT INTO `$table` (`fullname`, `uri`, `carddata`) VALUES (?, ?, ?)"); + $query->execute(array('fooBAR', 'foo', 'bar')); + + $query = OC_DB::prepare("SELECT * FROM `$table` WHERE `fullname` LIKE ?"); + $result = $query->execute(array('foobar')); + $this->assertCount(0, $result->fetchAll()); + + $query = OC_DB::prepare("SELECT * FROM `$table` WHERE `fullname` ILIKE ?"); + $result = $query->execute(array('foobar')); + $this->assertCount(1, $result->fetchAll()); + } } |