From 4bc2a22317dd65f142cf697cd10ed6920d930544 Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Tue, 17 Dec 2013 01:28:05 +0100 Subject: Remove all uses of numRows(). --- tests/lib/db.php | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'tests/lib/db.php') 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() { -- cgit v1.2.3