aboutsummaryrefslogtreecommitdiffstats
path: root/tests/lib/AppFramework/Db
diff options
context:
space:
mode:
Diffstat (limited to 'tests/lib/AppFramework/Db')
-rw-r--r--tests/lib/AppFramework/Db/EntityTest.php7
-rw-r--r--tests/lib/AppFramework/Db/QBMapperDBTest.php2
-rw-r--r--tests/lib/AppFramework/Db/QBMapperTest.php8
-rw-r--r--tests/lib/AppFramework/Db/TransactionalTest.php2
4 files changed, 9 insertions, 10 deletions
diff --git a/tests/lib/AppFramework/Db/EntityTest.php b/tests/lib/AppFramework/Db/EntityTest.php
index ccd0ae4bbaf..4fcf126e3b1 100644
--- a/tests/lib/AppFramework/Db/EntityTest.php
+++ b/tests/lib/AppFramework/Db/EntityTest.php
@@ -36,7 +36,6 @@ use PHPUnit\Framework\Constraint\IsType;
* @method void setDatetime(\DateTimeImmutable $datetime)
*/
class TestEntity extends Entity {
- protected $name;
protected $email;
protected $testId;
protected $smallInt;
@@ -49,7 +48,9 @@ class TestEntity extends Entity {
protected $time;
protected $datetime;
- public function __construct($name = null) {
+ public function __construct(
+ protected $name = null,
+ ) {
$this->addType('testId', Types::INTEGER);
$this->addType('smallInt', Types::SMALLINT);
$this->addType('bigInt', Types::BIGINT);
@@ -63,8 +64,6 @@ class TestEntity extends Entity {
$this->addType('trueOrFalse', 'bool');
$this->addType('legacyInt', 'int');
$this->addType('doubleNowFloat', 'double');
-
- $this->name = $name;
}
public function setAnotherBool(bool $anotherBool): void {
diff --git a/tests/lib/AppFramework/Db/QBMapperDBTest.php b/tests/lib/AppFramework/Db/QBMapperDBTest.php
index 72bc2d956d6..a61240fcb82 100644
--- a/tests/lib/AppFramework/Db/QBMapperDBTest.php
+++ b/tests/lib/AppFramework/Db/QBMapperDBTest.php
@@ -70,7 +70,7 @@ class QBMapperDBTest extends TestCase {
protected function setUp(): void {
parent::setUp();
- $this->connection = \OCP\Server::get(IDBConnection::class);
+ $this->connection = Server::get(IDBConnection::class);
$this->prepareTestingTable();
}
diff --git a/tests/lib/AppFramework/Db/QBMapperTest.php b/tests/lib/AppFramework/Db/QBMapperTest.php
index c1d8bf07234..1fac6632b30 100644
--- a/tests/lib/AppFramework/Db/QBMapperTest.php
+++ b/tests/lib/AppFramework/Db/QBMapperTest.php
@@ -127,7 +127,7 @@ class QBMapperTest extends \Test\TestCase {
];
$this->qb->expects($this->exactly(6))
->method('createNamedParameter')
- ->willReturnCallback(function () use (&$createNamedParameterCalls) {
+ ->willReturnCallback(function () use (&$createNamedParameterCalls): void {
$expected = array_shift($createNamedParameterCalls);
$this->assertEquals($expected, func_get_args());
});
@@ -142,7 +142,7 @@ class QBMapperTest extends \Test\TestCase {
];
$this->qb->expects($this->exactly(6))
->method('setValue')
- ->willReturnCallback(function () use (&$setValueCalls) {
+ ->willReturnCallback(function () use (&$setValueCalls): void {
$expected = array_shift($setValueCalls);
$this->assertEquals($expected, func_get_args());
});
@@ -184,7 +184,7 @@ class QBMapperTest extends \Test\TestCase {
];
$this->qb->expects($this->exactly(8))
->method('createNamedParameter')
- ->willReturnCallback(function () use (&$createNamedParameterCalls) {
+ ->willReturnCallback(function () use (&$createNamedParameterCalls): void {
$expected = array_shift($createNamedParameterCalls);
$this->assertEquals($expected, func_get_args());
});
@@ -200,7 +200,7 @@ class QBMapperTest extends \Test\TestCase {
];
$this->qb->expects($this->exactly(7))
->method('set')
- ->willReturnCallback(function () use (&$setCalls) {
+ ->willReturnCallback(function () use (&$setCalls): void {
$expected = array_shift($setCalls);
$this->assertEquals($expected, func_get_args());
});
diff --git a/tests/lib/AppFramework/Db/TransactionalTest.php b/tests/lib/AppFramework/Db/TransactionalTest.php
index a60c4386fea..bf8abcd7aa2 100644
--- a/tests/lib/AppFramework/Db/TransactionalTest.php
+++ b/tests/lib/AppFramework/Db/TransactionalTest.php
@@ -35,7 +35,7 @@ class TransactionalTest extends TestCase {
}
public function fail(): void {
- $this->atomic(function () {
+ $this->atomic(function (): void {
throw new RuntimeException('nope');
}, $this->db);
}