Simpletest fails with "invalid database prefix" - no other information given I am trying to setup a simple test that tests some breadcrumb altering code I have introduced only for a specific content type.

Here is the test, still just barebones:

namespace Drupal\mymodule_breadcrumbs\Tests;

use Drupal\simpletest\WebTestBase;

/**
 * Class ArticleBreadcrumbTest
 * @group mymodule_breadcrumbs
 */
class ArticleBreadcrumbTest extends WebTestBase {
  protected $node;
  private $account;

  /**
   * Modules to install.
   * @var array
   */
  public static $modules = ['node', 'mymodule_breadcrumbs', 'menu_breadcrumb'];

  /**
   * Set up our test.
   */
  public function setUp() {
    parent::setUp();

    // create admin user
    $this-&gt;account = $this-&gt;drupalCreateUser(['administer site configuration', 'administer content']);

    // create article node
    $this-&gt;node = $this-&gt;drupalCreateNode(array(
      'title' =&gt; t('Test Article'),
      'type' =&gt; 'article',
      'status' =&gt; 1,
    ));
  }

  public function testNodeTitleIsInBreadcrumb() {
    $this-&gt;drupalGet('node/' . $this-&gt;node-&gt;id());
    $this-&gt;assertResponse(200);
    #$this-&gt;assertText('Home &gt; ' . $this-&gt;node-&gt;getTitle(), 'Breadcrumb contains the node title.');
    // get page
    // test that breadcrumb is correct per node title
    // change node title
    // save node
    // visit node, check that breadcrumb is updated
  }
}


However, I am getting this error and not sure what to make of it:

The website encountered an unexpected error. Please try again later.

InvalidArgumentException: Invalid database prefix: in Drupal\Core\Test\TestDatabase-&gt;__construct() (line 81 of core/lib/Drupal/Core/Test/TestDatabase.php).
simpletest_log_read(NULL, , ) (Line: 476)
_simpletest_batch_finished(, Array, Array, '1 sec')
call_user_func_array('_simpletest_batch_finished', Array) (Line: 414)
_batch_finished() (Line: 81)
_batch_page(Object) (Line: 55)
Drupal\system\Controller\BatchController-&gt;batchPage(Object)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber-&gt;Drupal\Core\EventSubscriber\{closure}() (Line: 574)
Drupal\Core\Render\Renderer-&gt;executeInRenderContext(Object, Object) (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber-&gt;wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber-&gt;Drupal\Core\EventSubscriber\{closure}()
call_user_func_array(Object, Array) (Line: 144)
Symfony\Component\HttpKernel\HttpKernel-&gt;handleRaw(Object, 1) (Line: 64)
Symfony\Component\HttpKernel\HttpKernel-&gt;handle(Object, 1, 1) (Line: 57)
Drupal\Core\StackMiddleware\Session-&gt;handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\KernelPreHandle-&gt;handle(Object, 1, 1) (Line: 99)
Drupal\page_cache\StackMiddleware\PageCache-&gt;pass(Object, 1, 1) (Line: 78)
Drupal\page_cache\StackMiddleware\PageCache-&gt;handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware-&gt;handle(Object, 1, 1) (Line: 50)
Drupal\Core\StackMiddleware\NegotiationMiddleware-&gt;handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel-&gt;handle(Object, 1, 1) (Line: 652)
Drupal\Core\DrupalKernel-&gt;handle(Object) (Line: 19)


It's a very basic test, why would it cause an error like that?

Also I am running this from the UI runner, if that makes a difference.
For functional (browser) tests you need to provide some environment variables, in this case the SIMPLETEST_DB environment variable.

It can either be supplied in the phpunit.xml.dist file, or in phpunit command, or actually added to the environment before executing the phpunit command.

The format of the variable is seen in the phpunit.xml.dist file provided by Drupal core.

&lt;!-- Example SIMPLETEST_DB value: mysql://username:password@localhost/databasename#table_prefix --&gt;
&lt;env name="SIMPLETEST_DB" value=""/&gt;


From the error it seems that the provided SIMPLETEST_DB is not valid.

Note: the author mentioned that he was using the Admin UI and this answer does not address this problem.