Fix test of repair step
Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
parent
b1235a67de
commit
43b7b143f4
|
@ -1,9 +1,4 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace Test\Repair;
|
|
||||||
|
|
||||||
use OCP\Migration\IOutput;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Copyright (c) 2014 Thomas Müller <deepdiver@owncloud.com>
|
* Copyright (c) 2014 Thomas Müller <deepdiver@owncloud.com>
|
||||||
* This file is licensed under the Affero General Public License version 3 or
|
* This file is licensed under the Affero General Public License version 3 or
|
||||||
|
@ -11,6 +6,11 @@ use OCP\Migration\IOutput;
|
||||||
* See the COPYING-README file.
|
* See the COPYING-README file.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
namespace Test\Repair;
|
||||||
|
|
||||||
|
use OCP\ILogger;
|
||||||
|
use OCP\Migration\IOutput;
|
||||||
|
|
||||||
class TestCollationRepair extends \OC\Repair\Collation {
|
class TestCollationRepair extends \OC\Repair\Collation {
|
||||||
/**
|
/**
|
||||||
* @param \Doctrine\DBAL\Connection $connection
|
* @param \Doctrine\DBAL\Connection $connection
|
||||||
|
@ -50,10 +50,14 @@ class RepairCollationTest extends \Test\TestCase {
|
||||||
*/
|
*/
|
||||||
private $config;
|
private $config;
|
||||||
|
|
||||||
|
/** @var ILogger */
|
||||||
|
private $logger;
|
||||||
|
|
||||||
protected function setUp() {
|
protected function setUp() {
|
||||||
parent::setUp();
|
parent::setUp();
|
||||||
|
|
||||||
$this->connection = \OC::$server->getDatabaseConnection();
|
$this->connection = \OC::$server->getDatabaseConnection();
|
||||||
|
$this->logger = $this->createMock(ILogger::class);
|
||||||
$this->config = \OC::$server->getConfig();
|
$this->config = \OC::$server->getConfig();
|
||||||
if (!$this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySqlPlatform) {
|
if (!$this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySqlPlatform) {
|
||||||
$this->markTestSkipped("Test only relevant on MySql");
|
$this->markTestSkipped("Test only relevant on MySql");
|
||||||
|
@ -63,7 +67,7 @@ class RepairCollationTest extends \Test\TestCase {
|
||||||
$this->tableName = $this->getUniqueID($dbPrefix . "_collation_test");
|
$this->tableName = $this->getUniqueID($dbPrefix . "_collation_test");
|
||||||
$this->connection->exec("CREATE TABLE $this->tableName(text VARCHAR(16)) COLLATE utf8_unicode_ci");
|
$this->connection->exec("CREATE TABLE $this->tableName(text VARCHAR(16)) COLLATE utf8_unicode_ci");
|
||||||
|
|
||||||
$this->repair = new TestCollationRepair($this->config, $this->connection);
|
$this->repair = new TestCollationRepair($this->config, $this->logger, $this->connection, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function tearDown() {
|
protected function tearDown() {
|
||||||
|
|
Loading…
Reference in New Issue