diff options
author | Joas Schilling <nickvergessen@gmx.de> | 2014-11-10 23:30:38 +0100 |
---|---|---|
committer | Joas Schilling <nickvergessen@gmx.de> | 2014-11-19 14:53:59 +0100 |
commit | 6202ca33ba76a38b4aea8774018d661f919fa464 (patch) | |
tree | a108c8631dad790bc8c3fc175c9c330d18c54ad2 /tests/lib/db | |
parent | cb3a598cdb238f9ce74dce80ef9e59cdfc531a4f (diff) | |
download | nextcloud-server-6202ca33ba76a38b4aea8774018d661f919fa464.tar.gz nextcloud-server-6202ca33ba76a38b4aea8774018d661f919fa464.zip |
Make remaining files extend the test base
Diffstat (limited to 'tests/lib/db')
-rw-r--r-- | tests/lib/db/mdb2schemamanager.php | 6 | ||||
-rw-r--r-- | tests/lib/db/mdb2schemareader.php | 2 | ||||
-rw-r--r-- | tests/lib/db/migrator.php | 9 | ||||
-rw-r--r-- | tests/lib/db/mysqlmigration.php | 9 | ||||
-rw-r--r-- | tests/lib/db/sqlitemigration.php | 9 |
5 files changed, 23 insertions, 12 deletions
diff --git a/tests/lib/db/mdb2schemamanager.php b/tests/lib/db/mdb2schemamanager.php index 527b2cba648..3e6abab70b4 100644 --- a/tests/lib/db/mdb2schemamanager.php +++ b/tests/lib/db/mdb2schemamanager.php @@ -12,15 +12,17 @@ namespace Test\DB; use Doctrine\DBAL\Platforms\OraclePlatform; use Doctrine\DBAL\Platforms\SQLServerPlatform; -class MDB2SchemaManager extends \PHPUnit_Framework_TestCase { +class MDB2SchemaManager extends \Test\TestCase { - public function tearDown() { + protected function tearDown() { // do not drop the table for Oracle as it will create a bogus transaction // that will break the following test suites requiring transactions if (\OC::$server->getConfig()->getSystemValue('dbtype', 'sqlite') === 'oci') { return; } \OC_DB::dropTable('table'); + + parent::tearDown(); } public function testAutoIncrement() { diff --git a/tests/lib/db/mdb2schemareader.php b/tests/lib/db/mdb2schemareader.php index f08996cbeaf..b2ff55e1632 100644 --- a/tests/lib/db/mdb2schemareader.php +++ b/tests/lib/db/mdb2schemareader.php @@ -11,7 +11,7 @@ namespace Test\DB; use Doctrine\DBAL\Platforms\MySqlPlatform; -class MDB2SchemaReader extends \PHPUnit_Framework_TestCase { +class MDB2SchemaReader extends \Test\TestCase { /** * @var \OC\DB\MDB2SchemaReader $reader */ diff --git a/tests/lib/db/migrator.php b/tests/lib/db/migrator.php index 09742a53eb4..7acd3382fe2 100644 --- a/tests/lib/db/migrator.php +++ b/tests/lib/db/migrator.php @@ -15,7 +15,7 @@ use Doctrine\DBAL\Platforms\SQLServerPlatform; use \Doctrine\DBAL\Schema\Schema; use \Doctrine\DBAL\Schema\SchemaConfig; -class Migrator extends \PHPUnit_Framework_TestCase { +class Migrator extends \Test\TestCase { /** * @var \Doctrine\DBAL\Connection $connection */ @@ -28,7 +28,9 @@ class Migrator extends \PHPUnit_Framework_TestCase { private $tableName; - public function setUp() { + protected function setUp() { + parent::setUp(); + $this->connection = \OC_DB::getConnection(); if ($this->connection->getDatabasePlatform() instanceof OraclePlatform) { $this->markTestSkipped('DB migration tests are not supported on OCI'); @@ -40,8 +42,9 @@ class Migrator extends \PHPUnit_Framework_TestCase { $this->tableName = 'test_' . uniqid(); } - public function tearDown() { + protected function tearDown() { $this->connection->exec('DROP TABLE ' . $this->tableName); + parent::tearDown(); } /** diff --git a/tests/lib/db/mysqlmigration.php b/tests/lib/db/mysqlmigration.php index 584df1d4465..70199147760 100644 --- a/tests/lib/db/mysqlmigration.php +++ b/tests/lib/db/mysqlmigration.php @@ -6,7 +6,7 @@ * See the COPYING-README file. */ -class TestMySqlMigration extends \PHPUnit_Framework_TestCase { +class TestMySqlMigration extends \Test\TestCase { /** @var \Doctrine\DBAL\Connection */ private $connection; @@ -14,7 +14,9 @@ class TestMySqlMigration 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"); @@ -25,8 +27,9 @@ class TestMySqlMigration extends \PHPUnit_Framework_TestCase { $this->connection->exec("CREATE TABLE $this->tableName(b BIT, e ENUM('1','2','3','4'))"); } - public function tearDown() { + protected function tearDown() { $this->connection->getSchemaManager()->dropTable($this->tableName); + parent::tearDown(); } public function testNonOCTables() { diff --git a/tests/lib/db/sqlitemigration.php b/tests/lib/db/sqlitemigration.php index adfc03a2ca7..e3d0e386ab5 100644 --- a/tests/lib/db/sqlitemigration.php +++ b/tests/lib/db/sqlitemigration.php @@ -6,7 +6,7 @@ * See the COPYING-README file. */ -class TestSqliteMigration extends \PHPUnit_Framework_TestCase { +class TestSqliteMigration extends \Test\TestCase { /** @var \Doctrine\DBAL\Connection */ private $connection; @@ -14,7 +14,9 @@ class TestSqliteMigration 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\SqlitePlatform) { $this->markTestSkipped("Test only relevant on Sqlite"); @@ -25,8 +27,9 @@ class TestSqliteMigration extends \PHPUnit_Framework_TestCase { $this->connection->exec("CREATE TABLE $this->tableName(t0 tinyint unsigned, t1 tinyint)"); } - public function tearDown() { + protected function tearDown() { $this->connection->getSchemaManager()->dropTable($this->tableName); + parent::tearDown(); } public function testNonOCTables() { |