aboutsummaryrefslogtreecommitdiffstats
path: root/tests/lib/DB/MigratorTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/lib/DB/MigratorTest.php')
-rw-r--r--tests/lib/DB/MigratorTest.php12
1 files changed, 7 insertions, 5 deletions
diff --git a/tests/lib/DB/MigratorTest.php b/tests/lib/DB/MigratorTest.php
index c6afe5a053a..9d8ee6791a9 100644
--- a/tests/lib/DB/MigratorTest.php
+++ b/tests/lib/DB/MigratorTest.php
@@ -16,8 +16,10 @@ use OC\DB\Migrator;
use OC\DB\OracleMigrator;
use OC\DB\SQLiteMigrator;
use OCP\DB\Types;
+use OCP\EventDispatcher\IEventDispatcher;
use OCP\IConfig;
use OCP\IDBConnection;
+use OCP\Server;
/**
* Class MigratorTest
@@ -46,15 +48,15 @@ class MigratorTest extends \Test\TestCase {
protected function setUp(): void {
parent::setUp();
- $this->config = \OC::$server->getConfig();
- $this->connection = \OC::$server->get(\OC\DB\Connection::class);
+ $this->config = Server::get(IConfig::class);
+ $this->connection = Server::get(\OC\DB\Connection::class);
$this->tableName = $this->getUniqueTableName();
$this->tableNameTmp = $this->getUniqueTableName();
}
private function getMigrator(): Migrator {
- $dispatcher = \OC::$server->get(\OCP\EventDispatcher\IEventDispatcher::class);
+ $dispatcher = Server::get(IEventDispatcher::class);
if ($this->connection->getDatabaseProvider() === IDBConnection::PLATFORM_SQLITE) {
return new SQLiteMigrator($this->connection, $this->config, $dispatcher);
} elseif ($this->connection->getDatabaseProvider() === IDBConnection::PLATFORM_ORACLE) {
@@ -261,7 +263,7 @@ class MigratorTest extends \Test\TestCase {
$this->assertTrue($startSchema->getTable($this->tableNameTmp)->hasForeignKey($fkName));
}
- public function dataNotNullEmptyValuesFailOracle(): array {
+ public static function dataNotNullEmptyValuesFailOracle(): array {
return [
[ParameterType::BOOLEAN, true, Types::BOOLEAN, false],
[ParameterType::BOOLEAN, false, Types::BOOLEAN, true],
@@ -277,13 +279,13 @@ class MigratorTest extends \Test\TestCase {
}
/**
- * @dataProvider dataNotNullEmptyValuesFailOracle
*
* @param int $parameterType
* @param bool|int|string $value
* @param string $columnType
* @param bool $oracleThrows
*/
+ #[\PHPUnit\Framework\Attributes\DataProvider('dataNotNullEmptyValuesFailOracle')]
public function testNotNullEmptyValuesFailOracle(int $parameterType, $value, string $columnType, bool $oracleThrows): void {
$startSchema = new Schema([], [], $this->getSchemaConfig());
$table = $startSchema->createTable($this->tableName);