You are here

public function UrlConversionTest::providerInvalidArgumentGetConnectionInfoAsUrl in Drupal 8

Same name and namespace in other branches
  1. 9 core/tests/Drupal/Tests/Core/Database/UrlConversionTest.php \Drupal\Tests\Core\Database\UrlConversionTest::providerInvalidArgumentGetConnectionInfoAsUrl()
  2. 10 core/tests/Drupal/Tests/Core/Database/UrlConversionTest.php \Drupal\Tests\Core\Database\UrlConversionTest::providerInvalidArgumentGetConnectionInfoAsUrl()

Dataprovider 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 387

Class

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

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",
    ],
  ];
}