diff --git a/ci/github/phpunit/sqlite.xml b/ci/github/phpunit/sqlite.xml
index 90943141657..4639aa3a1b2 100644
--- a/ci/github/phpunit/sqlite.xml
+++ b/ci/github/phpunit/sqlite.xml
@@ -7,6 +7,10 @@
failOnRisky="true"
>
+
+
+
+
diff --git a/phpunit.xml.dist b/phpunit.xml.dist
index 39eaa5f1784..e965bf24319 100644
--- a/phpunit.xml.dist
+++ b/phpunit.xml.dist
@@ -33,22 +33,26 @@
-
+
+
+
+
diff --git a/tests/Doctrine/Tests/TestUtil.php b/tests/Doctrine/Tests/TestUtil.php
index 74a99cadbb9..604ac082b73 100644
--- a/tests/Doctrine/Tests/TestUtil.php
+++ b/tests/Doctrine/Tests/TestUtil.php
@@ -16,7 +16,6 @@
use function strlen;
use function strpos;
use function substr;
-use function unlink;
use const STDERR;
@@ -60,9 +59,8 @@ public static function getConnection(): Connection
fwrite(
STDERR,
sprintf(
- "\nUsing DB driver %s (from %s connection params)\n",
- get_class($conn->getDriver()),
- $params['is_fallback'] ? 'fallback' : 'specified'
+ "\nUsing DB driver %s\n",
+ get_class($conn->getDriver())
)
);
@@ -100,25 +98,7 @@ public static function getTempConnection(): Connection
*/
private static function getConnectionParams()
{
- if (self::hasRequiredConnectionParams()) {
- return self::getSpecifiedConnectionParams();
- }
-
- return self::getFallbackConnectionParams();
- }
-
- private static function hasRequiredConnectionParams(): bool
- {
- return isset($GLOBALS['db_driver']);
- }
-
- /**
- * @psalm-return array
- */
- private static function getSpecifiedConnectionParams()
- {
- $realDbParams = self::getParamsForMainConnection();
- $realDbParams['is_fallback'] = false;
+ $realDbParams = self::getParamsForMainConnection();
if (! self::$initialized) {
$tmpDbParams = self::getParamsForTemporaryConnection();
@@ -154,25 +134,6 @@ private static function getSpecifiedConnectionParams()
return $realDbParams;
}
- /**
- * @psalm-return array
- */
- private static function getFallbackConnectionParams()
- {
- $params = [
- 'driver' => 'pdo_sqlite',
- 'memory' => true,
- 'is_fallback' => true,
- ];
-
- if (isset($GLOBALS['db_path'])) {
- $params['path'] = $GLOBALS['db_path'];
- unlink($GLOBALS['db_path']);
- }
-
- return $params;
- }
-
private static function addDbEventSubscribers(Connection $conn): void
{
if (isset($GLOBALS['db_event_subscribers'])) {
@@ -204,6 +165,12 @@ private static function getParamsForTemporaryConnection()
*/
private static function getParamsForMainConnection()
{
+ if (! isset($GLOBALS['db_driver'])) {
+ throw new UnexpectedValueException(
+ 'You must provide database connection params including a db_driver value. See phpunit.xml.dist for details'
+ );
+ }
+
return self::mapConnectionParameters($GLOBALS, 'db_');
}
@@ -225,6 +192,7 @@ private static function mapConnectionParameters(array $configuration, string $pr
'dbname',
'port',
'server',
+ 'memory',
'ssl_key',
'ssl_cert',
'ssl_ca',