function UrlConversionTest::providerInvalidArgumentsUrlConversion

Same name in other branches
  1. 9 core/tests/Drupal/Tests/Core/Database/UrlConversionTest.php \Drupal\Tests\Core\Database\UrlConversionTest::providerInvalidArgumentsUrlConversion()
  2. 8.9.x core/tests/Drupal/Tests/Core/Database/UrlConversionTest.php \Drupal\Tests\Core\Database\UrlConversionTest::providerInvalidArgumentsUrlConversion()
  3. 11.x core/tests/Drupal/Tests/Core/Database/UrlConversionTest.php \Drupal\Tests\Core\Database\UrlConversionTest::providerInvalidArgumentsUrlConversion()

Data provider for testGetInvalidArgumentExceptionInUrlConversion().

Return value

array Array of arrays with the following elements:

  • An invalid URL string.
  • Drupal root string.
  • The expected exception message.

File

core/tests/Drupal/Tests/Core/Database/UrlConversionTest.php, line 296

Class

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

Namespace

Drupal\Tests\Core\Database

Code

public static function providerInvalidArgumentsUrlConversion() {
    return [
        [
            'foo',
            '',
            "Missing scheme in URL 'foo'",
        ],
        [
            'foo',
            'bar',
            "Missing scheme in URL 'foo'",
        ],
        [
            'foo://',
            'bar',
            "Can not convert 'foo://' to a database connection, the module providing the driver 'foo' is not specified",
        ],
        [
            'foo://bar',
            'baz',
            "Can not convert 'foo://bar' to a database connection, the module providing the driver 'foo' is not specified",
        ],
        [
            'foo://bar:port',
            'baz',
            "Can not convert 'foo://bar:port' to a database connection, the module providing the driver 'foo' is not specified",
        ],
        [
            'foo/bar/baz',
            'bar2',
            "Missing scheme in URL 'foo/bar/baz'",
        ],
        [
            'foo://bar:baz@test1',
            'test2',
            "Can not convert 'foo://bar:baz@test1' to a database connection, the module providing the driver 'foo' is not specified",
        ],
    ];
}

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