diff options
author | Christoph Wurst <christoph@winzerhof-wurst.at> | 2021-01-03 15:28:31 +0100 |
---|---|---|
committer | Christoph Wurst <christoph@winzerhof-wurst.at> | 2021-01-08 11:45:19 +0100 |
commit | 8b64e92b9262d2a2eec6345685ce421050f95c66 (patch) | |
tree | dd51490b8a184b2643414d11867a9fa450aa5065 /tests/lib/Repair | |
parent | 84e6e9f7cf19207041925eaa237d24e1c12c2c2d (diff) | |
download | nextcloud-server-8b64e92b9262d2a2eec6345685ce421050f95c66.tar.gz nextcloud-server-8b64e92b9262d2a2eec6345685ce421050f95c66.zip |
Bump doctrine/dbal from 2.12.0 to 3.0.0
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'tests/lib/Repair')
-rw-r--r-- | tests/lib/Repair/CleanTagsTest.php | 2 | ||||
-rw-r--r-- | tests/lib/Repair/RepairCollationTest.php | 9 | ||||
-rw-r--r-- | tests/lib/Repair/RepairSqliteAutoincrementTest.php | 7 |
3 files changed, 9 insertions, 9 deletions
diff --git a/tests/lib/Repair/CleanTagsTest.php b/tests/lib/Repair/CleanTagsTest.php index a56d79f9bc6..3f3ac0bf18d 100644 --- a/tests/lib/Repair/CleanTagsTest.php +++ b/tests/lib/Repair/CleanTagsTest.php @@ -122,7 +122,7 @@ class CleanTagsTest extends \Test\TestCase { ->from($tableName) ->execute(); - $this->assertEquals($expected, $result->fetchColumn(), $message); + $this->assertEquals($expected, $result->fetchOne(), $message); } /** diff --git a/tests/lib/Repair/RepairCollationTest.php b/tests/lib/Repair/RepairCollationTest.php index 9cba3e8e30a..35679eb8630 100644 --- a/tests/lib/Repair/RepairCollationTest.php +++ b/tests/lib/Repair/RepairCollationTest.php @@ -8,7 +8,6 @@ namespace Test\Repair; -use Doctrine\DBAL\Connection; use Doctrine\DBAL\Platforms\MySqlPlatform; use OC\Repair\Collation; use OCP\IDBConnection; @@ -41,7 +40,7 @@ class RepairCollationTest extends TestCase { private $repair; /** - * @var Connection|IDBConnection + * @var IDBConnection */ private $connection; @@ -61,7 +60,7 @@ class RepairCollationTest extends TestCase { protected function setUp(): void { parent::setUp(); - $this->connection = \OC::$server->getDatabaseConnection(); + $this->connection = \OC::$server->get(IDBConnection::class); $this->logger = $this->createMock(ILogger::class); $this->config = \OC::$server->getConfig(); if (!$this->connection->getDatabasePlatform() instanceof MySqlPlatform) { @@ -70,13 +69,13 @@ class RepairCollationTest extends TestCase { $dbPrefix = $this->config->getSystemValue("dbtableprefix"); $this->tableName = $this->getUniqueID($dbPrefix . "_collation_test"); - $this->connection->exec("CREATE TABLE $this->tableName(text VARCHAR(16)) COLLATE utf8_unicode_ci"); + $this->connection->prepare("CREATE TABLE $this->tableName(text VARCHAR(16)) COLLATE utf8_unicode_ci")->execute(); $this->repair = new TestCollationRepair($this->config, $this->logger, $this->connection, false); } protected function tearDown(): void { - $this->connection->getSchemaManager()->dropTable($this->tableName); + $this->connection->getInner()->getSchemaManager()->dropTable($this->tableName); parent::tearDown(); } diff --git a/tests/lib/Repair/RepairSqliteAutoincrementTest.php b/tests/lib/Repair/RepairSqliteAutoincrementTest.php index 9db0d5630aa..c03eb12b894 100644 --- a/tests/lib/Repair/RepairSqliteAutoincrementTest.php +++ b/tests/lib/Repair/RepairSqliteAutoincrementTest.php @@ -8,6 +8,7 @@ namespace Test\Repair; +use OC\DB\Connection; use OCP\Migration\IOutput; /** @@ -23,7 +24,7 @@ class RepairSqliteAutoincrementTest extends \Test\TestCase { private $repair; /** - * @var \Doctrine\DBAL\Connection + * @var Connection */ private $connection; @@ -40,7 +41,7 @@ class RepairSqliteAutoincrementTest extends \Test\TestCase { protected function setUp(): void { parent::setUp(); - $this->connection = \OC::$server->getDatabaseConnection(); + $this->connection = \OC::$server->get(\OC\DB\Connection::class); $this->config = \OC::$server->getConfig(); if (!$this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\SqlitePlatform) { $this->markTestSkipped("Test only relevant on Sqlite"); @@ -48,7 +49,7 @@ class RepairSqliteAutoincrementTest extends \Test\TestCase { $dbPrefix = $this->config->getSystemValue('dbtableprefix', 'oc_'); $this->tableName = $this->getUniqueID($dbPrefix . 'autoinc_test'); - $this->connection->exec('CREATE TABLE ' . $this->tableName . '("someid" INTEGER NOT NULL, "text" VARCHAR(16), PRIMARY KEY("someid"))'); + $this->connection->prepare('CREATE TABLE ' . $this->tableName . '("someid" INTEGER NOT NULL, "text" VARCHAR(16), PRIMARY KEY("someid"))')->execute(); $this->repair = new \OC\Repair\SqliteAutoincrement($this->connection); } |