public function UrlConversionTest::providerInvalidArgumentsUrlConversion in Drupal 8
Same name and namespace in other branches
- 9 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\DatabaseCode
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",
],
];
}