function UrlConversionTest::testGetInvalidArgumentExceptionInUrlConversion

Same name in other branches
  1. 9 core/tests/Drupal/Tests/Core/Database/UrlConversionTest.php \Drupal\Tests\Core\Database\UrlConversionTest::testGetInvalidArgumentExceptionInUrlConversion()
  2. 8.9.x core/tests/Drupal/Tests/Core/Database/UrlConversionTest.php \Drupal\Tests\Core\Database\UrlConversionTest::testGetInvalidArgumentExceptionInUrlConversion()
  3. 11.x core/tests/Drupal/Tests/Core/Database/UrlConversionTest.php \Drupal\Tests\Core\Database\UrlConversionTest::testGetInvalidArgumentExceptionInUrlConversion()

Tests ::convertDbUrlToConnectionInfo() exception for invalid arguments.

@dataProvider providerInvalidArgumentsUrlConversion

File

core/tests/Drupal/Tests/Core/Database/UrlConversionTest.php, line 281

Class

UrlConversionTest
Tests for database URL to/from database connection array conversions.

Namespace

Drupal\Tests\Core\Database

Code

public function testGetInvalidArgumentExceptionInUrlConversion($url, $root, $expected_exception_message) : void {
    $this->expectException(\InvalidArgumentException::class);
    $this->expectExceptionMessage($expected_exception_message);
    Database::convertDbUrlToConnectionInfo($url, $root);
}

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