You are here

public function BrowserTestBaseTest::testSimpleTestBaseUrlValidation in Drupal 9

Test if setting an invalid scheme in SIMPLETEST_BASE_URL throws an exception.

File

core/tests/Drupal/FunctionalTests/BrowserTestBaseTest.php, line 1009

Class

BrowserTestBaseTest
Tests BrowserTestBase functionality.

Namespace

Drupal\FunctionalTests

Code

public function testSimpleTestBaseUrlValidation() {
  putenv('SIMPLETEST_BASE_URL=mysql://user:pass@localhost/database');
  $this
    ->expectException(\Exception::class);
  $this
    ->expectExceptionMessage('You must provide valid scheme for the SIMPLETEST_BASE_URL environment variable. Valid schema are: http, https.');
  $this
    ->setupBaseUrl();
}