aboutsummaryrefslogtreecommitdiffstats
path: root/tests/lib/DB/MigrationsTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/lib/DB/MigrationsTest.php')
-rw-r--r--tests/lib/DB/MigrationsTest.php48
1 files changed, 24 insertions, 24 deletions
diff --git a/tests/lib/DB/MigrationsTest.php b/tests/lib/DB/MigrationsTest.php
index a088ca1baf0..531e0a3805a 100644
--- a/tests/lib/DB/MigrationsTest.php
+++ b/tests/lib/DB/MigrationsTest.php
@@ -55,14 +55,14 @@ class MigrationsTest extends \Test\TestCase {
$this->appManager = Server::get(IAppManager::class);
}
- public function testGetters() {
+ public function testGetters(): void {
$this->assertEquals('testing', $this->migrationService->getApp());
$this->assertEquals(\OC::$SERVERROOT . '/apps/testing/lib/Migration', $this->migrationService->getMigrationsDirectory());
$this->assertEquals('OCA\Testing\Migration', $this->migrationService->getMigrationsNamespace());
$this->assertEquals('test_oc_migrations', $this->migrationService->getMigrationsTableName());
}
- public function testCore() {
+ public function testCore(): void {
$this->migrationService = new MigrationService('core', $this->db);
$this->assertEquals('core', $this->migrationService->getApp());
@@ -72,7 +72,7 @@ class MigrationsTest extends \Test\TestCase {
}
- public function testExecuteUnknownStep() {
+ public function testExecuteUnknownStep(): void {
$this->expectException(\InvalidArgumentException::class);
$this->expectExceptionMessage('Version 20170130180000 is unknown.');
@@ -80,7 +80,7 @@ class MigrationsTest extends \Test\TestCase {
}
- public function testUnknownApp() {
+ public function testUnknownApp(): void {
$this->expectException(\Exception::class);
$this->expectExceptionMessage('App not found');
@@ -88,7 +88,7 @@ class MigrationsTest extends \Test\TestCase {
}
- public function testExecuteStepWithUnknownClass() {
+ public function testExecuteStepWithUnknownClass(): void {
$this->expectException(\Exception::class);
$this->expectExceptionMessage('Migration step \'X\' is unknown');
@@ -102,7 +102,7 @@ class MigrationsTest extends \Test\TestCase {
$this->migrationService->executeStep('20170130180000');
}
- public function testExecuteStepWithSchemaChange() {
+ public function testExecuteStepWithSchemaChange(): void {
$schema = $this->createMock(Schema::class);
$this->db->expects($this->any())
->method('createSchema')
@@ -145,7 +145,7 @@ class MigrationsTest extends \Test\TestCase {
$this->migrationService->executeStep('20170130180000');
}
- public function testExecuteStepWithoutSchemaChange() {
+ public function testExecuteStepWithoutSchemaChange(): void {
$schema = $this->createMock(Schema::class);
$this->db->expects($this->any())
->method('createSchema')
@@ -189,7 +189,7 @@ class MigrationsTest extends \Test\TestCase {
* @param string $alias
* @param string $expected
*/
- public function testGetMigration($alias, $expected) {
+ public function testGetMigration($alias, $expected): void {
$this->migrationService = $this->getMockBuilder(MigrationService::class)
->setMethods(['getMigratedVersions', 'findMigrations'])
->setConstructorArgs(['testing', $this->db])
@@ -209,7 +209,7 @@ class MigrationsTest extends \Test\TestCase {
$this->assertEquals($expected, $migration);
}
- public function testMigrate() {
+ public function testMigrate(): void {
$this->migrationService = $this->getMockBuilder(MigrationService::class)
->setMethods(['getMigratedVersions', 'findMigrations', 'executeStep'])
->setConstructorArgs(['testing', $this->db])
@@ -230,7 +230,7 @@ class MigrationsTest extends \Test\TestCase {
$this->migrationService->migrate();
}
- public function testEnsureOracleConstraintsValid() {
+ public function testEnsureOracleConstraintsValid(): void {
$column = $this->createMock(Column::class);
$column->expects($this->once())
->method('getName')
@@ -293,7 +293,7 @@ class MigrationsTest extends \Test\TestCase {
self::invokePrivate($this->migrationService, 'ensureOracleConstraints', [$sourceSchema, $schema, 3]);
}
- public function testEnsureOracleConstraintsValidWithPrimaryKey() {
+ public function testEnsureOracleConstraintsValidWithPrimaryKey(): void {
$index = $this->createMock(Index::class);
$index->expects($this->any())
->method('getName')
@@ -336,7 +336,7 @@ class MigrationsTest extends \Test\TestCase {
self::invokePrivate($this->migrationService, 'ensureOracleConstraints', [$sourceSchema, $schema, 3]);
}
- public function testEnsureOracleConstraintsValidWithPrimaryKeyDefault() {
+ public function testEnsureOracleConstraintsValidWithPrimaryKeyDefault(): void {
$defaultName = 'PRIMARY';
if ($this->db->getDatabaseProvider() === IDBConnection::PLATFORM_POSTGRES) {
$defaultName = \str_repeat('a', 26) . '_' . \str_repeat('b', 30) . '_seq';
@@ -390,7 +390,7 @@ class MigrationsTest extends \Test\TestCase {
}
- public function testEnsureOracleConstraintsTooLongTableName() {
+ public function testEnsureOracleConstraintsTooLongTableName(): void {
$this->expectException(\InvalidArgumentException::class);
$table = $this->createMock(Table::class);
@@ -415,7 +415,7 @@ class MigrationsTest extends \Test\TestCase {
}
- public function testEnsureOracleConstraintsTooLongPrimaryWithDefault() {
+ public function testEnsureOracleConstraintsTooLongPrimaryWithDefault(): void {
$this->expectException(\InvalidArgumentException::class);
$defaultName = 'PRIMARY';
@@ -468,7 +468,7 @@ class MigrationsTest extends \Test\TestCase {
}
- public function testEnsureOracleConstraintsTooLongPrimaryWithName() {
+ public function testEnsureOracleConstraintsTooLongPrimaryWithName(): void {
$this->expectException(\InvalidArgumentException::class);
$index = $this->createMock(Index::class);
@@ -511,7 +511,7 @@ class MigrationsTest extends \Test\TestCase {
}
- public function testEnsureOracleConstraintsTooLongColumnName() {
+ public function testEnsureOracleConstraintsTooLongColumnName(): void {
$this->expectException(\InvalidArgumentException::class);
$column = $this->createMock(Column::class);
@@ -545,7 +545,7 @@ class MigrationsTest extends \Test\TestCase {
}
- public function testEnsureOracleConstraintsTooLongIndexName() {
+ public function testEnsureOracleConstraintsTooLongIndexName(): void {
$this->expectException(\InvalidArgumentException::class);
$index = $this->createMock(Index::class);
@@ -582,7 +582,7 @@ class MigrationsTest extends \Test\TestCase {
}
- public function testEnsureOracleConstraintsTooLongForeignKeyName() {
+ public function testEnsureOracleConstraintsTooLongForeignKeyName(): void {
$this->expectException(\InvalidArgumentException::class);
$foreignKey = $this->createMock(ForeignKeyConstraint::class);
@@ -622,7 +622,7 @@ class MigrationsTest extends \Test\TestCase {
}
- public function testEnsureOracleConstraintsNoPrimaryKey() {
+ public function testEnsureOracleConstraintsNoPrimaryKey(): void {
$this->markTestSkipped('Test disabled for now due to multiple reasons, see https://github.com/nextcloud/server/pull/31580#issuecomment-1069182234 for details.');
$this->expectException(\InvalidArgumentException::class);
@@ -663,7 +663,7 @@ class MigrationsTest extends \Test\TestCase {
}
- public function testEnsureOracleConstraintsTooLongSequenceName() {
+ public function testEnsureOracleConstraintsTooLongSequenceName(): void {
$this->expectException(\InvalidArgumentException::class);
$sequence = $this->createMock(Sequence::class);
@@ -691,7 +691,7 @@ class MigrationsTest extends \Test\TestCase {
}
- public function testEnsureOracleConstraintsBooleanNotNull() {
+ public function testEnsureOracleConstraintsBooleanNotNull(): void {
$this->expectException(\InvalidArgumentException::class);
$column = $this->createMock(Column::class);
@@ -731,7 +731,7 @@ class MigrationsTest extends \Test\TestCase {
}
- public function testEnsureOracleConstraintsStringLength4000() {
+ public function testEnsureOracleConstraintsStringLength4000(): void {
$this->expectException(\InvalidArgumentException::class);
$column = $this->createMock(Column::class);
@@ -771,7 +771,7 @@ class MigrationsTest extends \Test\TestCase {
}
- public function testExtractMigrationAttributes() {
+ public function testExtractMigrationAttributes(): void {
$metadataManager = Server::get(MetadataManager::class);
$this->appManager->loadApp('testing');
@@ -780,7 +780,7 @@ class MigrationsTest extends \Test\TestCase {
$this->appManager->disableApp('testing');
}
- public function testDeserializeMigrationMetadata() {
+ public function testDeserializeMigrationMetadata(): void {
$metadataManager = Server::get(MetadataManager::class);
$this->assertEquals(
[