function DatabaseDriverListTest::testLegacyGetFromDriverName

@covers ::getFromDriverName @group legacy

@dataProvider providerDatabaseDrivers

File

core/tests/Drupal/Tests/Core/Extension/DatabaseDriverListTest.php, line 51

Class

DatabaseDriverListTest
Tests DatabaseDriverList methods.

Namespace

Drupal\Tests\Core\Extension

Code

public function testLegacyGetFromDriverName(string $driverName, string $moduleName, string $driverExtensionName) : void {
    $this->expectDeprecation('Drupal\\Core\\Extension\\DatabaseDriverList::getFromDriverName() is deprecated in drupal:10.2.0 and is removed from drupal:11.0.0. Use DatabaseDriverList::get() instead, passing a database driver namespace. See https://www.drupal.org/node/3258175');
    $driverExtension = Database::getDriverList()->includeTestDrivers(TRUE)
        ->getFromDriverName($driverName);
    $this->assertSame($driverExtensionName, $driverExtension->getName());
    $this->assertSame($moduleName, $driverExtension->getModule()
        ->getName());
    $this->assertSame($driverName, $driverExtension->getDriverName());
}

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