You are here

public function UrlConversionTest::providerInvalidArgumentGetConnectionInfoAsUrl 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::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 379

Class

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

Namespace

Drupal\Tests\Core\Database

Code

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