aboutsummaryrefslogtreecommitdiffstats
path: root/tests/lib/repair
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@gmx.de>2014-11-10 23:30:38 +0100
committerJoas Schilling <nickvergessen@gmx.de>2014-11-19 14:53:59 +0100
commit6202ca33ba76a38b4aea8774018d661f919fa464 (patch)
treea108c8631dad790bc8c3fc175c9c330d18c54ad2 /tests/lib/repair
parentcb3a598cdb238f9ce74dce80ef9e59cdfc531a4f (diff)
downloadnextcloud-server-6202ca33ba76a38b4aea8774018d661f919fa464.tar.gz
nextcloud-server-6202ca33ba76a38b4aea8774018d661f919fa464.zip
Make remaining files extend the test base
Diffstat (limited to 'tests/lib/repair')
-rw-r--r--tests/lib/repair/repaircollation.php9
-rw-r--r--tests/lib/repair/repairinnodb.php9
-rw-r--r--tests/lib/repair/repairlegacystorage.php10
-rw-r--r--tests/lib/repair/repairmimetypes.php9
4 files changed, 25 insertions, 12 deletions
diff --git a/tests/lib/repair/repaircollation.php b/tests/lib/repair/repaircollation.php
index 362feb8463f..e711fcd9d83 100644
--- a/tests/lib/repair/repaircollation.php
+++ b/tests/lib/repair/repaircollation.php
@@ -21,7 +21,7 @@ class TestCollationRepair extends \OC\Repair\Collation {
*
* @see \OC\Repair\RepairMimeTypes
*/
-class TestRepairCollation extends PHPUnit_Framework_TestCase {
+class TestRepairCollation extends \Test\TestCase {
/**
* @var TestCollationRepair
@@ -43,7 +43,9 @@ class TestRepairCollation extends PHPUnit_Framework_TestCase {
*/
private $config;
- public function setUp() {
+ protected function setUp() {
+ parent::setUp();
+
$this->connection = \OC_DB::getConnection();
$this->config = \OC::$server->getConfig();
if (!$this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySqlPlatform) {
@@ -57,8 +59,9 @@ class TestRepairCollation extends PHPUnit_Framework_TestCase {
$this->repair = new TestCollationRepair($this->config, $this->connection);
}
- public function tearDown() {
+ protected function tearDown() {
$this->connection->getSchemaManager()->dropTable($this->tableName);
+ parent::tearDown();
}
public function testCollationConvert() {
diff --git a/tests/lib/repair/repairinnodb.php b/tests/lib/repair/repairinnodb.php
index e7d2442f127..21d7d978821 100644
--- a/tests/lib/repair/repairinnodb.php
+++ b/tests/lib/repair/repairinnodb.php
@@ -11,7 +11,7 @@
*
* @see \OC\Repair\RepairMimeTypes
*/
-class TestRepairInnoDB extends PHPUnit_Framework_TestCase {
+class TestRepairInnoDB extends \Test\TestCase {
/** @var \OC\RepairStep */
private $repair;
@@ -22,7 +22,9 @@ class TestRepairInnoDB extends PHPUnit_Framework_TestCase {
/** @var string */
private $tableName;
- public function setUp() {
+ protected function setUp() {
+ parent::setUp();
+
$this->connection = \OC_DB::getConnection();
if (!$this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySqlPlatform) {
$this->markTestSkipped("Test only relevant on MySql");
@@ -35,8 +37,9 @@ class TestRepairInnoDB extends PHPUnit_Framework_TestCase {
$this->repair = new \OC\Repair\InnoDB();
}
- public function tearDown() {
+ protected function tearDown() {
$this->connection->getSchemaManager()->dropTable($this->tableName);
+ parent::tearDown();
}
public function testInnoDBConvert() {
diff --git a/tests/lib/repair/repairlegacystorage.php b/tests/lib/repair/repairlegacystorage.php
index 4528c5288df..ac845657cd9 100644
--- a/tests/lib/repair/repairlegacystorage.php
+++ b/tests/lib/repair/repairlegacystorage.php
@@ -11,7 +11,7 @@
*
* @see \OC\Repair\RepairLegacyStorages
*/
-class TestRepairLegacyStorages extends PHPUnit_Framework_TestCase {
+class TestRepairLegacyStorages extends \Test\TestCase {
private $user;
private $repair;
@@ -22,7 +22,9 @@ class TestRepairLegacyStorages extends PHPUnit_Framework_TestCase {
private $legacyStorageId;
private $newStorageId;
- public function setUp() {
+ protected function setUp() {
+ parent::setUp();
+
$this->config = \OC::$server->getConfig();
$this->connection = \OC_DB::getConnection();
$this->oldDataDir = $this->config->getSystemValue('datadirectory', \OC::$SERVERROOT . '/data/');
@@ -30,7 +32,7 @@ class TestRepairLegacyStorages extends PHPUnit_Framework_TestCase {
$this->repair = new \OC\Repair\RepairLegacyStorages($this->config, $this->connection);
}
- public function tearDown() {
+ protected function tearDown() {
\OC_User::deleteUser($this->user);
$sql = 'DELETE FROM `*PREFIX*storages`';
@@ -39,6 +41,8 @@ class TestRepairLegacyStorages extends PHPUnit_Framework_TestCase {
$this->connection->executeQuery($sql);
\OCP\Config::setSystemValue('datadirectory', $this->oldDataDir);
$this->config->setAppValue('core', 'repairlegacystoragesdone', 'no');
+
+ parent::tearDown();
}
function prepareSettings($dataDir, $userId) {
diff --git a/tests/lib/repair/repairmimetypes.php b/tests/lib/repair/repairmimetypes.php
index 7754864a69e..6eaf68d8a44 100644
--- a/tests/lib/repair/repairmimetypes.php
+++ b/tests/lib/repair/repairmimetypes.php
@@ -11,26 +11,29 @@
*
* @see \OC\Repair\RepairMimeTypes
*/
-class TestRepairMimeTypes extends PHPUnit_Framework_TestCase {
+class TestRepairMimeTypes extends \Test\TestCase {
/** @var \OC\RepairStep */
private $repair;
private $storage;
- public function setUp() {
+ protected function setUp() {
+ parent::setUp();
$this->storage = new \OC\Files\Storage\Temporary(array());
$this->repair = new \OC\Repair\RepairMimeTypes();
}
- public function tearDown() {
+ protected function tearDown() {
$this->storage->getCache()->clear();
$sql = 'DELETE FROM `*PREFIX*storages` WHERE `id` = ?';
\OC_DB::executeAudited($sql, array($this->storage->getId()));
$this->clearMimeTypes();
DummyFileCache::clearCachedMimeTypes();
+
+ parent::tearDown();
}
private function clearMimeTypes() {