Skip to content

Commit 0d261a3

Browse files
Fix old NC instances with correct dependencies
Signed-off-by: Christian Wolf <[email protected]>
1 parent bcf28f8 commit 0d261a3

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

tests/Integration/Setup/Migrations/Version000000Date20210701093123Test.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
use PHPUnit\Framework\TestCase;
1111
use OC\DB\MigrationService;
1212
use OC\DB\Connection;
13+
use OCP\Util;
1314

1415
class Version000000Date20210701093123Test extends TestCase {
1516

@@ -47,7 +48,12 @@ public function setUp(): void {
4748
$schema = $this->container->query(SchemaWrapper::class);
4849
$this->assertIsObject($schema);
4950

50-
$connection = \OC::$server->query(Connection::class);
51+
if(Util::getVersion()[0] >= 21){
52+
$connection = \OC::$server->query(Connection::class);
53+
} else
54+
{
55+
$connection = $this->db;
56+
}
5157
$this->migrationService = new MigrationService('cookbook', $connection);
5258

5359
// undo all migrations of cookbook app

0 commit comments

Comments
 (0)