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. 10 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()

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

Class

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

Namespace

Drupal\Tests\Core\Database

Code

public 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, class 'Drupal\\Driver\\Database\\foo\\Connection' does not exist",
        ],
        [
            'foo://bar',
            'baz',
            "Can not convert 'foo://bar' to a database connection, class 'Drupal\\Driver\\Database\\foo\\Connection' does not exist",
        ],
        [
            'foo://bar:port',
            'baz',
            "Can not convert 'foo://bar:port' to a database connection, class 'Drupal\\Driver\\Database\\foo\\Connection' does not exist",
        ],
        [
            '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, class 'Drupal\\Driver\\Database\\foo\\Connection' does not exist",
        ],
    ];
}

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