Skip to content

Commit d4c694b

Browse files
committed
Fix: sharedDatabases getConnection() instancof-check always false
1 parent e83124b commit d4c694b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/Test/SharedDatabases.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,13 +85,14 @@ final public static function sharedDatabases(): array
8585
final protected function getConnection(): Connection
8686
{
8787
if (method_exists($this, 'getProvidedData')) {
88-
$connection = $this->getProvidedData();
88+
$connections = $this->getProvidedData();
8989
} elseif (method_exists($this, 'providedData')) {
90-
$connection = $this->providedData();
90+
$connections = $this->providedData();
9191
} else {
9292
throw new RuntimeException('Cannot get connection: Unsupported PHPUnit version?');
9393
}
9494

95+
$connection = $connections[0];
9596
if (! $connection instanceof Connection) {
9697
throw new RuntimeException('Cannot get connection: Are all test cases using the same provider?');
9798
}

0 commit comments

Comments
 (0)