From 394772b5f714cdaaef5a8ca5169b2ceed1aba579 Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Thu, 15 Dec 2022 00:36:04 -0800 Subject: [PATCH] CiviUnitTestCase - Simplify console message. Remove unused method 'getDBName()'. --- tests/phpunit/CiviTest/CiviUnitTestCase.php | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/tests/phpunit/CiviTest/CiviUnitTestCase.php b/tests/phpunit/CiviTest/CiviUnitTestCase.php index 99484fe82e..5f4f9462f9 100644 --- a/tests/phpunit/CiviTest/CiviUnitTestCase.php +++ b/tests/phpunit/CiviTest/CiviUnitTestCase.php @@ -240,20 +240,6 @@ class CiviUnitTestCase extends PHPUnit\Framework\TestCase { } } - /** - * @return string - */ - public static function getDBName() { - static $dbName = NULL; - if ($dbName === NULL) { - require_once "DB.php"; - $dsn = CRM_Utils_SQL::autoSwitchDSN(CIVICRM_DSN); - $dsninfo = DB::parseDSN($dsn); - $dbName = $dsninfo['database']; - } - return $dbName; - } - /** * Declare the environment that we wish to run in. * @@ -301,9 +287,7 @@ class CiviUnitTestCase extends PHPUnit\Framework\TestCase { } if (!self::$dbInit) { - $dbName = self::getDBName(); - // install test database - echo PHP_EOL . "Installing {$dbName} database" . PHP_EOL; + fprintf(STDERR, "\nInstalling %s database\n", \Civi\Test::dsn('database')); \Civi\Test::asPreInstall([static::CLASS, 'buildEnvironment'])->apply(TRUE); self::$dbInit = TRUE; } -- 2.25.1