summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJörn Friedrich Dreyer <jfd@butonic.de>2013-06-20 15:38:02 +0200
committerJörn Friedrich Dreyer <jfd@butonic.de>2013-06-24 16:29:59 +0200
commit1b97c186b4f2946753123fb73314597b818aea70 (patch)
tree75995f48570423a13dabe996f8e025feeeb9f184 /tests
parentc79f7f4f3cb460f890fccb5a7de7d62ea0a5fc15 (diff)
downloadnextcloud-server-1b97c186b4f2946753123fb73314597b818aea70.tar.gz
nextcloud-server-1b97c186b4f2946753123fb73314597b818aea70.zip
use assertEquals number of rows in db tests
Diffstat (limited to 'tests')
-rw-r--r--tests/lib/db.php8
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/lib/db.php b/tests/lib/db.php
index afbdb413c3d..0ba7d5d4b06 100644
--- a/tests/lib/db.php
+++ b/tests/lib/db.php
@@ -40,7 +40,7 @@ class Test_DB extends PHPUnit_Framework_TestCase {
$this->assertFalse((bool)$row); //PDO returns false, MDB2 returns null
$query = OC_DB::prepare('INSERT INTO `*PREFIX*'.$this->table2.'` (`fullname`,`uri`) VALUES (?,?)');
$result = $query->execute(array('fullname test', 'uri_1'));
- $this->assertTrue((bool)$result);
+ $this->assertEquals('1', $result);
$query = OC_DB::prepare('SELECT `fullname`,`uri` FROM `*PREFIX*'.$this->table2.'` WHERE `uri` = ?');
$result = $query->execute(array('uri_1'));
$this->assertTrue((bool)$result);
@@ -57,7 +57,7 @@ class Test_DB extends PHPUnit_Framework_TestCase {
public function testNOW() {
$query = OC_DB::prepare('INSERT INTO `*PREFIX*'.$this->table2.'` (`fullname`,`uri`) VALUES (NOW(),?)');
$result = $query->execute(array('uri_2'));
- $this->assertTrue((bool)$result);
+ $this->assertEquals('1', $result);
$query = OC_DB::prepare('SELECT `fullname`,`uri` FROM `*PREFIX*'.$this->table2.'` WHERE `uri` = ?');
$result = $query->execute(array('uri_2'));
$this->assertTrue((bool)$result);
@@ -66,7 +66,7 @@ class Test_DB extends PHPUnit_Framework_TestCase {
public function testUNIX_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);
+ $this->assertEquals('1', $result);
$query = OC_DB::prepare('SELECT `fullname`,`uri` FROM `*PREFIX*'.$this->table2.'` WHERE `uri` = ?');
$result = $query->execute(array('uri_3'));
$this->assertTrue((bool)$result);
@@ -105,7 +105,7 @@ class Test_DB extends PHPUnit_Framework_TestCase {
// Normal test to have same known data inserted.
$query = OC_DB::prepare('INSERT INTO `*PREFIX*'.$this->table2.'` (`fullname`, `uri`, `carddata`) VALUES (?, ?, ?)');
$result = $query->execute(array($fullname, $uri, $carddata));
- $this->assertTrue((bool)$result);
+ $this->assertEquals('1', $result);
$query = OC_DB::prepare('SELECT `fullname`, `uri`, `carddata` FROM `*PREFIX*'.$this->table2.'` WHERE `uri` = ?');
$result = $query->execute(array($uri));
$this->assertTrue((bool)$result);