You are here

public function UrlConversionTest::testGetConnectionInfoAsUrl in Drupal 9

Same name and namespace in other branches
  1. 8 core/tests/Drupal/Tests/Core/Database/UrlConversionTest.php \Drupal\Tests\Core\Database\UrlConversionTest::testGetConnectionInfoAsUrl()

@covers ::getConnectionInfoAsUrl

@dataProvider providerGetConnectionInfoAsUrl

File

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

Class

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

Namespace

Drupal\Tests\Core\Database

Code

public function testGetConnectionInfoAsUrl(array $info, $expected_url) {
  Database::addConnectionInfo('default', 'default', $info);
  $url = Database::getConnectionInfoAsUrl();
  $this
    ->assertEquals($expected_url, $url);
}