From ed066a812914b84c8f0c44e0e6be432638a3e038 Mon Sep 17 00:00:00 2001 From: anoy Date: Sat, 17 Jul 2021 19:33:36 +0200 Subject: adapt tests to QBMapper changes in NC22 Signed-off-by: anoy --- tests/Unit/Db/MapperTestUtility.php | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) (limited to 'tests/Unit/Db/MapperTestUtility.php') diff --git a/tests/Unit/Db/MapperTestUtility.php b/tests/Unit/Db/MapperTestUtility.php index b5ef782c2..5c58613ee 100644 --- a/tests/Unit/Db/MapperTestUtility.php +++ b/tests/Unit/Db/MapperTestUtility.php @@ -23,11 +23,10 @@ namespace OCA\News\Tests\Unit\Db; -use Doctrine\DBAL\Driver\Statement; +use OCP\DB\IResult; use OCP\DB\QueryBuilder\IQueryBuilder; use OCP\IDBConnection; -use PDOStatement; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; @@ -42,18 +41,13 @@ abstract class MapperTestUtility extends TestCase */ protected $db; - /** - * @var MockObject|PDOStatement - */ - protected $query; - /** * @var MockObject|IQueryBuilder */ protected $builder; /** - * @var MockObject|Statement + * @var MockObject|IResult */ protected $cursor; @@ -70,15 +64,12 @@ abstract class MapperTestUtility extends TestCase ->disableOriginalConstructor() ->getMock(); - $this->query = $this->getMockBuilder(PDOStatement::class) - ->getMock(); - $this->builder = $this->getMockBuilder(IQueryBuilder::class) ->disableOriginalConstructor() ->getMock(); - $this->cursor = $this->getMockBuilder(Statement::class) - ->addMethods(['fetch', 'closeCursor']) - ->getMockForAbstractClass(); + $this->cursor = $this->getMockBuilder(IResult::class) + ->disableOriginalConstructor() + ->getMock(); } } -- cgit v1.2.3