summaryrefslogtreecommitdiffstats
path: root/tests/Unit/Db
diff options
context:
space:
mode:
Diffstat (limited to 'tests/Unit/Db')
-rw-r--r--tests/Unit/Db/FolderMapperTest.php10
-rw-r--r--tests/Unit/Db/MapperTestUtility.php8
2 files changed, 8 insertions, 10 deletions
diff --git a/tests/Unit/Db/FolderMapperTest.php b/tests/Unit/Db/FolderMapperTest.php
index f3ee15456..11c411b5e 100644
--- a/tests/Unit/Db/FolderMapperTest.php
+++ b/tests/Unit/Db/FolderMapperTest.php
@@ -16,6 +16,8 @@ namespace OCA\News\Tests\Unit\Db;
use OCA\News\Db\Folder;
use OCA\News\Db\FolderMapper;
use OCA\News\Utility\Time;
+use OCP\AppFramework\Db\DoesNotExistException;
+use OCP\AppFramework\Db\MultipleObjectsReturnedException;
class FolderMapperTest extends MapperTestUtility
{
@@ -76,9 +78,7 @@ class FolderMapperTest extends MapperTestUtility
$this->setMapperResult($sql, [$id, $userId]);
- $this->expectException(
- '\OCP\AppFramework\Db\DoesNotExistException'
- );
+ $this->expectException(DoesNotExistException::class);
$this->folderMapper->find($id, $userId);
}
@@ -94,9 +94,7 @@ class FolderMapperTest extends MapperTestUtility
$this->setMapperResult($sql, [$id, $userId], $rows);
- $this->expectException(
- '\OCP\AppFramework\Db\MultipleObjectsReturnedException'
- );
+ $this->expectException(MultipleObjectsReturnedException::class);
$this->folderMapper->find($id, $userId);
}
diff --git a/tests/Unit/Db/MapperTestUtility.php b/tests/Unit/Db/MapperTestUtility.php
index 0c45a0bba..5417e16bc 100644
--- a/tests/Unit/Db/MapperTestUtility.php
+++ b/tests/Unit/Db/MapperTestUtility.php
@@ -23,6 +23,8 @@
namespace OCA\News\Tests\Unit\Db;
+use OCP\IDBConnection;
+
use PHPUnit\Framework\TestCase;
/**
* Simple utility class for testing mappers
@@ -45,13 +47,11 @@ abstract class MapperTestUtility extends TestCase
{
parent::setUp();
- $this->db = $this->getMockBuilder(
- '\OCP\IDBConnection'
- )
+ $this->db = $this->getMockBuilder(IDBConnection::class)
->disableOriginalConstructor()
->getMock();
- $this->query = $this->createMock('\PDOStatement');
+ $this->query = $this->createMock(\PDOStatement::class);
$this->queryAt = 0;
$this->prepareAt = 0;
$this->iterators = [];