BrowserTest on a multisite gives an error
It is possible to have a multisite directory setup with PHP Unit.

Since your default directory is empty, I suggest creating a symbolic link from the default directory to the site1 directory. You can do that by using commands similar to this one from sites directory.

ln -s sites1 default


Not sure, but you may also need to adjust the $sites variable in sites.php.

Also, make sure you specify a printerClass like this in the last line.

&lt;phpunit bootstrap="tests/bootstrap.php" colors="true"
         beStrictAboutTestsThatDoNotTestAnything="true"
         beStrictAboutOutputDuringTests="true"
         beStrictAboutChangesToGlobalState="true"
         checkForUnintentionallyCoveredCode="false"
         printerClass="\Drupal\Tests\Listeners\HtmlOutputPrinter"&gt;


Here is what my php tag looks like in phpunit.xml (I use SQLite though and specify an output directory.) You may need to adjust directory permissions so that it is writable. I test on my remote machine with a FQDN, not sure if that is ideal though.

&lt;php&gt;
    &lt;!-- Set error reporting to E_ALL. --&gt;
    &lt;ini name="error_reporting" value="32767"/&gt;
    &lt;!-- Do not limit the amount of memory tests take to run. --&gt;
    &lt;ini name="memory_limit" value="-1"/&gt;
    &lt;!-- Example SIMPLETEST_BASE_URL value: http://localhost --&gt;
    &lt;env name="SIMPLETEST_BASE_URL" value="https://dev.example.com"/&gt;
    &lt;!-- Example SIMPLETEST_DB value: mysql://username:password@localhost/databasename#table_prefix --&gt;
    &lt;env name="SIMPLETEST_DB" value="sqlite://dev.example.com/sites/dev.example.com/files/.ht.sqlite"/&gt;
    &lt;!-- Example BROWSERTEST_OUTPUT_DIRECTORY value: /path/to/webroot/sites/simpletest/browser_output --&gt;
    &lt;env name="BROWSERTEST_OUTPUT_DIRECTORY" value="/path/to/document/root/sites/dev.example.com/files/simpletest/browser_output"/&gt;
&lt;/php&gt;


Also, I run the phpunit command from the Drupal core directory like this (I do not use group ID but I know it may be possible.

sudo -u www-data ../vendor/bin/phpunit ../modules/contrib/example/tests/src/Functional/ExampleHomepageTest.php


Here is what my test looks like. It will need the correct directory structure and classname.

&lt;?php

namespace Drupal\Tests\example\Functional;

use Drupal\Tests\BrowserTestBase;

/**
 * Tests to ensure Example.com Homepage is reachable
 *
 * @group example_ui
 */
class ExampleHomepageTest extends BrowserTestBase {

/**
 * Modules to enable.
 *
 * @var array
 */
protected static $modules = ['node', 'user'];

protected $profile = 'standard';

/**
 * {@inheritdoc}
 */
public function setUp() {
parent::setUp();

}

/**
  * Tests that the reaction rule listing page works.
  */
public function testHomepage() {

  $account = $this-&gt;drupalCreateUser(array('administer site configuration'));
  $this-&gt;drupalLogin($account);

  $this-&gt;drupalGet('&lt;front&gt;');
  $this-&gt;assertSession()-&gt;statusCodeEquals(200);
  $this-&gt;assertSession()-&gt;pageTextContains('cleaning');
 }
}


This page will be useful: https://www.drupal.org/docs/8/phpunit