function UrlConversionTest::providerInvalidArgumentGetConnectionInfoAsUrl

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

Data provider for testGetInvalidArgumentGetConnectionInfoAsUrl().

Return value

array Array of arrays with the following elements:

  • An array mocking the database connection info. Possible keys are database, username, password, prefix, host, port, namespace and driver.
  • The expected exception message.

File

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

Class

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

Namespace

Drupal\Tests\Core\Database

Code

public static function providerInvalidArgumentGetConnectionInfoAsUrl() {
    return [
        'Missing database key' => [
            [
                'driver' => 'sqlite',
                'host' => 'localhost',
                'namespace' => 'Drupal\\sqlite\\Driver\\Database\\sqlite',
            ],
            "As a minimum, the connection options array must contain at least the 'driver' and 'database' keys",
        ],
    ];
}

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