function InstallerObjectTest::providerDbInstallerObject

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

Data provider 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 <a href="/api/drupal/core%21includes%21install.inc/function/db_installer_object/9" title="Returns a database installer object." class="local">db_installer_object</a>() function that is used during installation.

Namespace

Drupal\Tests\Core\Database

Code

public function providerDbInstallerObject() {
    return [
        // A driver only in the core namespace.
[
            'mysql',
            "Drupal\\mysql\\Driver\\Database\\mysql",
            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,
        ],
    ];
}

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