diff options
author | Jörn Friedrich Dreyer <jfd@butonic.de> | 2013-06-10 09:53:29 +0200 |
---|---|---|
committer | Jörn Friedrich Dreyer <jfd@butonic.de> | 2013-06-10 09:53:29 +0200 |
commit | 124f34422c3b488869e0348c97d87aa0a69a3fe9 (patch) | |
tree | 2502586fedff5feab3967d4720eabf15875e617b /tests | |
parent | b237d0379162b52269a6ea8292165d448d075f46 (diff) | |
download | nextcloud-server-124f34422c3b488869e0348c97d87aa0a69a3fe9.tar.gz nextcloud-server-124f34422c3b488869e0348c97d87aa0a69a3fe9.zip |
add missing backticks all over the place
Diffstat (limited to 'tests')
-rw-r--r-- | tests/lib/db.php | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/tests/lib/db.php b/tests/lib/db.php index 440f3fb6bfd..eff01bd9065 100644 --- a/tests/lib/db.php +++ b/tests/lib/db.php @@ -33,15 +33,15 @@ class Test_DB extends PHPUnit_Framework_TestCase { } public function testQuotes() { - $query = OC_DB::prepare('SELECT `fullname` FROM *PREFIX*'.$this->table2.' WHERE `uri` = ?'); + $query = OC_DB::prepare('SELECT `fullname` FROM `*PREFIX*'.$this->table2.'` WHERE `uri` = ?'); $result = $query->execute(array('uri_1')); $this->assertTrue((bool)$result); $row = $result->fetchRow(); $this->assertFalse($row); - $query = OC_DB::prepare('INSERT INTO *PREFIX*'.$this->table2.' (`fullname`,`uri`) VALUES (?,?)'); + $query = OC_DB::prepare('INSERT INTO `*PREFIX*'.$this->table2.'` (`fullname`,`uri`) VALUES (?,?)'); $result = $query->execute(array('fullname test', 'uri_1')); $this->assertTrue((bool)$result); - $query = OC_DB::prepare('SELECT `fullname`,`uri` FROM *PREFIX*'.$this->table2.' WHERE `uri` = ?'); + $query = OC_DB::prepare('SELECT `fullname`,`uri` FROM `*PREFIX*'.$this->table2.'` WHERE `uri` = ?'); $result = $query->execute(array('uri_1')); $this->assertTrue((bool)$result); $row = $result->fetchRow(); @@ -52,19 +52,19 @@ class Test_DB extends PHPUnit_Framework_TestCase { } public function testNOW() { - $query = OC_DB::prepare('INSERT INTO *PREFIX*'.$this->table2.' (`fullname`,`uri`) VALUES (NOW(),?)'); + $query = OC_DB::prepare('INSERT INTO `*PREFIX*'.$this->table2.'` (`fullname`,`uri`) VALUES (NOW(),?)'); $result = $query->execute(array('uri_2')); $this->assertTrue((bool)$result); - $query = OC_DB::prepare('SELECT `fullname`,`uri` FROM *PREFIX*'.$this->table2.' WHERE `uri` = ?'); + $query = OC_DB::prepare('SELECT `fullname`,`uri` FROM `*PREFIX*'.$this->table2.'` WHERE `uri` = ?'); $result = $query->execute(array('uri_2')); $this->assertTrue((bool)$result); } public function testUNIX_TIMESTAMP() { - $query = OC_DB::prepare('INSERT INTO *PREFIX*'.$this->table2.' (`fullname`,`uri`) VALUES (UNIX_TIMESTAMP(),?)'); + $query = OC_DB::prepare('INSERT INTO `*PREFIX*'.$this->table2.'` (`fullname`,`uri`) VALUES (UNIX_TIMESTAMP(),?)'); $result = $query->execute(array('uri_3')); $this->assertTrue((bool)$result); - $query = OC_DB::prepare('SELECT `fullname`,`uri` FROM *PREFIX*'.$this->table2.' WHERE `uri` = ?'); + $query = OC_DB::prepare('SELECT `fullname`,`uri` FROM `*PREFIX*'.$this->table2.'` WHERE `uri` = ?'); $result = $query->execute(array('uri_3')); $this->assertTrue((bool)$result); } @@ -88,7 +88,7 @@ class Test_DB extends PHPUnit_Framework_TestCase { $this->assertTrue((bool)$result); } - $query = OC_DB::prepare('SELECT * FROM *PREFIX*'.$this->table3); + $query = OC_DB::prepare('SELECT * FROM `*PREFIX*'.$this->table3.'`'); $result = $query->execute(); $this->assertTrue((bool)$result); $this->assertEquals('4', $result->numRows()); @@ -100,10 +100,10 @@ class Test_DB extends PHPUnit_Framework_TestCase { $carddata = 'This is a vCard'; // Normal test to have same known data inserted. - $query = OC_DB::prepare('INSERT INTO *PREFIX*'.$this->table2.' (`fullname`, `uri`, `carddata`) VALUES (?, ?, ?)'); + $query = OC_DB::prepare('INSERT INTO `*PREFIX*'.$this->table2.'` (`fullname`, `uri`, `carddata`) VALUES (?, ?, ?)'); $result = $query->execute(array($fullname, $uri, $carddata)); $this->assertTrue((bool)$result); - $query = OC_DB::prepare('SELECT `fullname`, `uri`, `carddata` FROM *PREFIX*'.$this->table2.' WHERE `uri` = ?'); + $query = OC_DB::prepare('SELECT `fullname`, `uri`, `carddata` FROM `*PREFIX*'.$this->table2.'` WHERE `uri` = ?'); $result = $query->execute(array($uri)); $this->assertTrue((bool)$result); $row = $result->fetchRow(); @@ -119,7 +119,7 @@ class Test_DB extends PHPUnit_Framework_TestCase { )); $this->assertTrue((bool)$result); - $query = OC_DB::prepare('SELECT `fullname`, `uri`, `carddata` FROM *PREFIX*'.$this->table2.' WHERE `uri` = ?'); + $query = OC_DB::prepare('SELECT `fullname`, `uri`, `carddata` FROM `*PREFIX*'.$this->table2.'` WHERE `uri` = ?'); $result = $query->execute(array($uri)); $this->assertTrue((bool)$result); $row = $result->fetchRow(); |