Running tests with phpunit command line is not working any more in Drupal 9.
PHPUnit 8.5.3 by Sebastian Bergmann and contributors.
Runtime: PHP 7.3.16-1+ubuntu18.04.1+deb.sury.org+1 with Xdebug 2.9.3
Configuration: /var/www/drupal9_test/htdocs/web/core/phpunit.xml.dist
Testing web/modules/contrib/mymodule/
E 1 / 1 (100%)
Time: 2.02 seconds, Memory: 8.00 MB
There was 1 error:
1) Drupal\Tests\mymodule\Functional\Test::testTranslation
Drupal\Core\Installer\Exception\AlreadyInstalledException: <ul>
<li>To start over, you must empty your existing database and copy <em>default.settings.php</em> over <em>settings.php</em>.</li>
<li>To upgrade an existing installation, proceed to the <a href="/update.php">update script</a>.</li>
<li>View your <a href="http://drupal9test.local">existing site</a>.</li>
</ul>
/var/www/drupal9_test/htdocs/web/core/includes/install.core.inc:527
/var/www/drupal9_test/htdocs/web/core/includes/install.core.inc:114
/var/www/drupal9_test/htdocs/web/core/lib/Drupal/Core/Test/FunctionalTestSetupTrait.php:286
/var/www/drupal9_test/htdocs/web/core/tests/Drupal/Tests/BrowserTestBase.php:574
/var/www/drupal9_test/htdocs/web/core/tests/Drupal/Tests/BrowserTestBase.php:407
/var/www/drupal9_test/htdocs/web/modules/contrib/mymodule/tests/src/Functional/Test.php:90
/var/www/drupal9_test/htdocs/vendor/phpunit/phpunit/src/Framework/TestResult.php:691
In the simpletest site settings.php file some settings are added, but no database configuration:
$settings['file_public_path'] = 'sites/simpletest/28077198/files';
$settings['file_private_path'] = 'sites/simpletest/28077198/private';
$settings['file_temp_path'] = 'sites/simpletest/28077198/temp';
$settings['test_parent_site'] = 'sites/default';
$settings['apcu_ensure_unique_prefix'] = false;
command line (see https://www.drupal.org/docs/8/testing/phpunit-in-drupal-8/running-phpuni...):
export SIMPLETEST_BASE_URL="http://drupal9test.local/"
export BROWSERTEST_OUTPUT_DIRECTORY="/tmp"
export SIMPLETEST_DB="sqlite://localhost/sites/default/files/db.sqlite"
vendor/bin/phpunit -c ./web/core -v web/modules/contrib/mymodule/tests/src/Functional/