summaryrefslogtreecommitdiffstats
path: root/tests/lib/DB
diff options
context:
space:
mode:
authorChristoph Wurst <christoph@winzerhof-wurst.at>2020-04-10 14:19:56 +0200
committerChristoph Wurst <christoph@winzerhof-wurst.at>2020-04-10 14:19:56 +0200
commitcaff1023ea72bb2ea94130e18a2a6e2ccf819e5f (patch)
tree186d494c2aea5dea7255d3584ef5d595fc6e6194 /tests/lib/DB
parentedf8ce32cffdb920e8171207b342abbd7f1fbe73 (diff)
downloadnextcloud-server-caff1023ea72bb2ea94130e18a2a6e2ccf819e5f.tar.gz
nextcloud-server-caff1023ea72bb2ea94130e18a2a6e2ccf819e5f.zip
Format control structures, classes, methods and function
To continue this formatting madness, here's a tiny patch that adds unified formatting for control structures like if and loops as well as classes, their methods and anonymous functions. This basically forces the constructs to start on the same line. This is not exactly what PSR2 wants, but I think we can have a few exceptions with "our" style. The starting of braces on the same line is pracrically standard for our code. This also removes and empty lines from method/function bodies at the beginning and end. Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'tests/lib/DB')
-rw-r--r--tests/lib/DB/ConnectionFactoryTest.php1
-rw-r--r--tests/lib/DB/ConnectionTest.php5
-rw-r--r--tests/lib/DB/MDB2SchemaManagerTest.php3
-rw-r--r--tests/lib/DB/MigrationsTest.php2
-rw-r--r--tests/lib/DB/MigratorTest.php6
-rw-r--r--tests/lib/DB/MySqlMigrationTest.php1
-rw-r--r--tests/lib/DB/OCPostgreSqlPlatformTest.php2
-rw-r--r--tests/lib/DB/SchemaDiffTest.php1
-rw-r--r--tests/lib/DB/SqliteMigrationTest.php1
9 files changed, 6 insertions, 16 deletions
diff --git a/tests/lib/DB/ConnectionFactoryTest.php b/tests/lib/DB/ConnectionFactoryTest.php
index 6a1a9b31c4b..de232bb1fdd 100644
--- a/tests/lib/DB/ConnectionFactoryTest.php
+++ b/tests/lib/DB/ConnectionFactoryTest.php
@@ -26,7 +26,6 @@ use OC\SystemConfig;
use Test\TestCase;
class ConnectionFactoryTest extends TestCase {
-
public function splitHostFromPortAndSocketData() {
return [
['127.0.0.1', ['host' => '127.0.0.1']],
diff --git a/tests/lib/DB/ConnectionTest.php b/tests/lib/DB/ConnectionTest.php
index 607674d7a38..c8b2b7ee13e 100644
--- a/tests/lib/DB/ConnectionTest.php
+++ b/tests/lib/DB/ConnectionTest.php
@@ -213,7 +213,7 @@ class ConnectionTest extends \Test\TestCase {
['user' => 'test2', 'category' => 'Coworkers', 'expectedResult' => 1],
];
- foreach($categoryEntries as $entry) {
+ foreach ($categoryEntries as $entry) {
$result = $this->connection->insertIfNotExist('*PREFIX*table',
[
'textfield' => $entry['user'],
@@ -236,7 +236,7 @@ class ConnectionTest extends \Test\TestCase {
['addressbookid' => 123, 'fullname' => 'test', 'expectedResult' => 1],
];
- foreach($categoryEntries as $entry) {
+ foreach ($categoryEntries as $entry) {
$result = $this->connection->insertIfNotExist('*PREFIX*table',
[
'integerfield_default' => $entry['addressbookid'],
@@ -347,5 +347,4 @@ class ConnectionTest extends \Test\TestCase {
$this->connection->executeUpdate($testQuery, $testParams);
$this->connection->executeUpdate($testQuery, $testParams);
}
-
}
diff --git a/tests/lib/DB/MDB2SchemaManagerTest.php b/tests/lib/DB/MDB2SchemaManagerTest.php
index d83131a685f..18af9716502 100644
--- a/tests/lib/DB/MDB2SchemaManagerTest.php
+++ b/tests/lib/DB/MDB2SchemaManagerTest.php
@@ -19,7 +19,6 @@ use Doctrine\DBAL\Platforms\OraclePlatform;
* @package Test\DB
*/
class MDB2SchemaManagerTest extends \Test\TestCase {
-
protected function tearDown(): void {
// do not drop the table for Oracle as it will create a bogus transaction
// that will break the following test suites requiring transactions
@@ -31,7 +30,6 @@ class MDB2SchemaManagerTest extends \Test\TestCase {
}
public function testAutoIncrement() {
-
$connection = \OC::$server->getDatabaseConnection();
if ($connection->getDatabasePlatform() instanceof OraclePlatform) {
$this->markTestSkipped('Adding auto increment columns in Oracle is not supported.');
@@ -48,5 +46,4 @@ class MDB2SchemaManagerTest extends \Test\TestCase {
$this->addToAssertionCount(1);
}
-
}
diff --git a/tests/lib/DB/MigrationsTest.php b/tests/lib/DB/MigrationsTest.php
index 52e849fd0a8..c4e9b1857fb 100644
--- a/tests/lib/DB/MigrationsTest.php
+++ b/tests/lib/DB/MigrationsTest.php
@@ -92,7 +92,6 @@ class MigrationsTest extends \Test\TestCase {
}
public function testExecuteStepWithSchemaChange() {
-
$schema = $this->createMock(Schema::class);
$this->db->expects($this->any())
->method('createSchema')
@@ -136,7 +135,6 @@ class MigrationsTest extends \Test\TestCase {
}
public function testExecuteStepWithoutSchemaChange() {
-
$schema = $this->createMock(Schema::class);
$this->db->expects($this->any())
->method('createSchema')
diff --git a/tests/lib/DB/MigratorTest.php b/tests/lib/DB/MigratorTest.php
index a438d0189df..b5021dcccf9 100644
--- a/tests/lib/DB/MigratorTest.php
+++ b/tests/lib/DB/MigratorTest.php
@@ -65,11 +65,13 @@ class MigratorTest extends \Test\TestCase {
// Try to delete if exists (IF EXISTS NOT SUPPORTED IN ORACLE)
try {
$this->connection->exec('DROP TABLE ' . $this->connection->quoteIdentifier($this->tableNameTmp));
- } catch (\Doctrine\DBAL\DBALException $e) {}
+ } catch (\Doctrine\DBAL\DBALException $e) {
+ }
try {
$this->connection->exec('DROP TABLE ' . $this->connection->quoteIdentifier($this->tableName));
- } catch (\Doctrine\DBAL\DBALException $e) {}
+ } catch (\Doctrine\DBAL\DBALException $e) {
+ }
parent::tearDown();
}
diff --git a/tests/lib/DB/MySqlMigrationTest.php b/tests/lib/DB/MySqlMigrationTest.php
index 5ebbd273c33..36ab8ef7319 100644
--- a/tests/lib/DB/MySqlMigrationTest.php
+++ b/tests/lib/DB/MySqlMigrationTest.php
@@ -45,5 +45,4 @@ class MySqlMigrationTest extends \Test\TestCase {
$this->addToAssertionCount(1);
}
-
}
diff --git a/tests/lib/DB/OCPostgreSqlPlatformTest.php b/tests/lib/DB/OCPostgreSqlPlatformTest.php
index 54701bdcec9..0821a988eb5 100644
--- a/tests/lib/DB/OCPostgreSqlPlatformTest.php
+++ b/tests/lib/DB/OCPostgreSqlPlatformTest.php
@@ -37,7 +37,6 @@ use Doctrine\DBAL\Types\Type;
* @package Test\DB
*/
class OCPostgreSqlPlatformTest extends \Test\TestCase {
-
public function testAlterBigint() {
$platform = new PostgreSqlPlatform();
$sourceSchema = new Schema();
@@ -71,5 +70,4 @@ class OCPostgreSqlPlatformTest extends \Test\TestCase {
'length' => 11,
]);
}
-
}
diff --git a/tests/lib/DB/SchemaDiffTest.php b/tests/lib/DB/SchemaDiffTest.php
index c98cf173d8f..29d456805d5 100644
--- a/tests/lib/DB/SchemaDiffTest.php
+++ b/tests/lib/DB/SchemaDiffTest.php
@@ -71,7 +71,6 @@ class SchemaDiffTest extends TestCase {
* @param string $xml
*/
public function testZeroChangeOnSchemaMigrations($xml) {
-
$xml = str_replace('*dbprefix*', $this->testPrefix, $xml);
$schemaFile = $this->schemaFile;
file_put_contents($schemaFile, $xml);
diff --git a/tests/lib/DB/SqliteMigrationTest.php b/tests/lib/DB/SqliteMigrationTest.php
index ecc6cbe0951..480a5ebe74f 100644
--- a/tests/lib/DB/SqliteMigrationTest.php
+++ b/tests/lib/DB/SqliteMigrationTest.php
@@ -45,5 +45,4 @@ class SqliteMigrationTest extends \Test\TestCase {
$this->addToAssertionCount(1);
}
-
}