You are here

public function InstallerObjectTest::providerDbInstallerObject in Drupal 8

Same name and namespace in other branches
  1. 9 core/tests/Drupal/Tests/Core/Database/InstallerObjectTest.php \Drupal\Tests\Core\Database\InstallerObjectTest::providerDbInstallerObject()

Dataprovider for testDbUrltoConnectionConversion().

Return value

array Array of arrays with the following elements:

  • driver: The driver name.
  • namespace: The namespace providing the driver.
  • class: The fully qualified class name of the expected install task.

File

core/tests/Drupal/Tests/Core/Database/InstallerObjectTest.php, line 58

Class

InstallerObjectTest
Tests the db_installer_object() function that is used during installation.

Namespace

Drupal\Tests\Core\Database

Code

public function providerDbInstallerObject() {
  return [
    // A driver only in the core namespace.
    [
      'mysql',
      NULL,
      MysqlInstallTasks::class,
    ],
    // A driver only in the custom namespace.
    [
      'fake',
      "Drupal\\Driver\\Database\\fake",
      FakeInstallTasks::class,
    ],
    // A driver in both namespaces. The custom one takes precedence.
    [
      'corefake',
      "Drupal\\Driver\\Database\\corefake",
      CustomCoreFakeInstallTasks::class,
    ],
    // A driver from a module that has a different name as the driver.
    [
      'DrivertestMysql',
      "Drupal\\driver_test\\Driver\\Database\\DrivertestMysql",
      DriverTestMysqlInstallTasks::class,
    ],
  ];
}