diff options
Diffstat (limited to 'tests/lib/Repair/RepairCollationTest.php')
-rw-r--r-- | tests/lib/Repair/RepairCollationTest.php | 9 |
1 files changed, 4 insertions, 5 deletions
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(); } |