diff options
Diffstat (limited to 'tests/lib/appframework/db/mappertest.php')
-rw-r--r-- | tests/lib/appframework/db/mappertest.php | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/tests/lib/appframework/db/mappertest.php b/tests/lib/appframework/db/mappertest.php index 9cbc01883e3..8e585c479bb 100644 --- a/tests/lib/appframework/db/mappertest.php +++ b/tests/lib/appframework/db/mappertest.php @@ -24,7 +24,7 @@ namespace OCP\AppFramework\Db; -use \OCP\IDb; +use \OCP\IDBConnection; use Test\AppFramework\Db\MapperTestUtility; /** @@ -42,7 +42,7 @@ class Example extends Entity { class ExampleMapper extends Mapper { - public function __construct(IDb $db){ parent::__construct($db, 'table'); } + public function __construct(IDBConnection $db){ parent::__construct($db, 'table'); } public function find($table, $id){ return $this->findOneQuery($table, $id); } public function findOneEntity($table, $id){ return $this->findEntity($table, $id); } public function findAllEntities($table){ return $this->findEntities($table); } @@ -137,7 +137,7 @@ class MapperTest extends MapperTestUtility { $sql = 'DELETE FROM `*PREFIX*table` WHERE `id` = ?'; $params = array(2); - $this->setMapperResult($sql, $params); + $this->setMapperResult($sql, $params, [], null, null, true); $entity = new Example(); $entity->setId($params[0]); @@ -147,7 +147,7 @@ class MapperTest extends MapperTestUtility { public function testCreate(){ $this->db->expects($this->once()) - ->method('getInsertId') + ->method('lastInsertId') ->with($this->equalTo('*PREFIX*table')) ->will($this->returnValue(3)); $this->mapper = new ExampleMapper($this->db); @@ -159,7 +159,7 @@ class MapperTest extends MapperTestUtility { $entity->setPreName($params[0]); $entity->setEmail($params[1]); - $this->setMapperResult($sql, $params); + $this->setMapperResult($sql, $params, [], null, null, true); $this->mapper->insert($entity); } @@ -167,7 +167,7 @@ class MapperTest extends MapperTestUtility { public function testCreateShouldReturnItemWithCorrectInsertId(){ $this->db->expects($this->once()) - ->method('getInsertId') + ->method('lastInsertId') ->with($this->equalTo('*PREFIX*table')) ->will($this->returnValue(3)); $this->mapper = new ExampleMapper($this->db); @@ -200,7 +200,7 @@ class MapperTest extends MapperTestUtility { $entity->setEmail($params[1]); $entity->setId($params[2]); - $this->setMapperResult($sql, $params); + $this->setMapperResult($sql, $params, [], null, null, true); $this->mapper->update($entity); } |