function BrowserTestBaseTest::testSimpleTestBaseUrlValidation

Same name in other branches
  1. 9 core/tests/Drupal/FunctionalTests/BrowserTestBaseTest.php \Drupal\FunctionalTests\BrowserTestBaseTest::testSimpleTestBaseUrlValidation()
  2. 10 core/tests/Drupal/FunctionalTests/BrowserTestBaseTest.php \Drupal\FunctionalTests\BrowserTestBaseTest::testSimpleTestBaseUrlValidation()

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

File

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

Class

BrowserTestBaseTest
Tests BrowserTestBase functionality.

Namespace

Drupal\FunctionalTests

Code

public function testSimpleTestBaseUrlValidation() : void {
    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();
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.