|
|
|
|
@ -31,7 +31,6 @@ class TestCollationRepair extends Collation {
|
|
|
|
|
/**
|
|
|
|
|
* Tests for the converting of MySQL tables to InnoDB engine
|
|
|
|
|
*
|
|
|
|
|
*
|
|
|
|
|
* @see \OC\Repair\RepairMimeTypes
|
|
|
|
|
*/
|
|
|
|
|
#[\PHPUnit\Framework\Attributes\Group('DB')]
|
|
|
|
|
@ -48,13 +47,13 @@ class RepairCollationTest extends TestCase {
|
|
|
|
|
parent::setUp();
|
|
|
|
|
|
|
|
|
|
$this->connection = Server::get(ConnectionAdapter::class);
|
|
|
|
|
$this->config = Server::get(IConfig::class);
|
|
|
|
|
if ($this->connection->getDatabaseProvider() !== IDBConnection::PLATFORM_MYSQL) {
|
|
|
|
|
$this->markTestSkipped('Test only relevant on MySql');
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$this->logger = $this->createMock(LoggerInterface::class);
|
|
|
|
|
|
|
|
|
|
$this->config = Server::get(IConfig::class);
|
|
|
|
|
$dbPrefix = $this->config->getSystemValueString('dbtableprefix');
|
|
|
|
|
$this->tableName = $this->getUniqueID($dbPrefix . '_collation_test');
|
|
|
|
|
$this->connection->prepare("CREATE TABLE $this->tableName(text VARCHAR(16)) COLLATE utf8_unicode_ci")->execute();
|
|
|
|
|
@ -63,7 +62,11 @@ class RepairCollationTest extends TestCase {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected function tearDown(): void {
|
|
|
|
|
$this->connection = Server::get(ConnectionAdapter::class);
|
|
|
|
|
if ($this->connection->getDatabaseProvider() === IDBConnection::PLATFORM_MYSQL) {
|
|
|
|
|
// tear down only needed on MySQL
|
|
|
|
|
$this->connection->getInner()->createSchemaManager()->dropTable($this->tableName);
|
|
|
|
|
}
|
|
|
|
|
parent::tearDown();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|