diff options
author | Andreas Fischer <bantu@owncloud.com> | 2013-12-17 01:28:05 +0100 |
---|---|---|
committer | Andreas Fischer <bantu@owncloud.com> | 2013-12-21 19:56:14 +0100 |
commit | 4bc2a22317dd65f142cf697cd10ed6920d930544 (patch) | |
tree | 7b8625f810440eae4a117c9aa63daabb8f5982c5 /tests/lib/db.php | |
parent | 63a2bea7ec0171595f2a96639827e9d477fc6878 (diff) | |
download | nextcloud-server-4bc2a22317dd65f142cf697cd10ed6920d930544.tar.gz nextcloud-server-4bc2a22317dd65f142cf697cd10ed6920d930544.zip |
Remove all uses of numRows().
Diffstat (limited to 'tests/lib/db.php')
-rw-r--r-- | tests/lib/db.php | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/tests/lib/db.php b/tests/lib/db.php index 96d5f873b5c..f0b271a36f1 100644 --- a/tests/lib/db.php +++ b/tests/lib/db.php @@ -137,10 +137,10 @@ class Test_DB extends PHPUnit_Framework_TestCase { $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(); - $this->assertArrayHasKey('carddata', $row); - $this->assertEquals($carddata, $row['carddata']); - $this->assertEquals(1, $result->numRows()); + $rowset = $result->fetchAll(); + $this->assertEquals(1, count($rowset)); + $this->assertArrayHasKey('carddata', $rowset[0]); + $this->assertEquals($carddata, $rowset[0]['carddata']); // Try to insert a new row $result = OC_DB::insertIfNotExist('*PREFIX*'.$this->table2, @@ -153,13 +153,12 @@ class Test_DB extends PHPUnit_Framework_TestCase { $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(); - $this->assertArrayHasKey('carddata', $row); // Test that previously inserted data isn't overwritten - $this->assertEquals($carddata, $row['carddata']); // And that a new row hasn't been inserted. - $this->assertEquals(1, $result->numRows()); - + $rowset = $result->fetchAll(); + $this->assertEquals(1, count($rowset)); + $this->assertArrayHasKey('carddata', $rowset[0]); + $this->assertEquals($carddata, $rowset[0]['carddata']); } public function testUtf8Data() { |