function UrlConversionTest::testGetConnectionInfoAsUrl

Same name in other branches
  1. 8.9.x core/tests/Drupal/Tests/Core/Database/UrlConversionTest.php \Drupal\Tests\Core\Database\UrlConversionTest::testGetConnectionInfoAsUrl()
  2. 10 core/tests/Drupal/Tests/Core/Database/UrlConversionTest.php \Drupal\Tests\Core\Database\UrlConversionTest::testGetConnectionInfoAsUrl()
  3. 11.x 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 290

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);
}

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