public static function UrlHelperTest::providerTestFilterBadProtocol in Drupal 10
Same name and namespace in other branches
- 8 core/tests/Drupal/Tests/Component/Utility/UrlHelperTest.php \Drupal\Tests\Component\Utility\UrlHelperTest::providerTestFilterBadProtocol()
- 9 core/tests/Drupal/Tests/Component/Utility/UrlHelperTest.php \Drupal\Tests\Component\Utility\UrlHelperTest::providerTestFilterBadProtocol()
Provides data for self::testTestFilterBadProtocol().
Return value
array
File
- core/
tests/ Drupal/ Tests/ Component/ Utility/ UrlHelperTest.php, line 466
Class
- UrlHelperTest
- @group Utility
Namespace
Drupal\Tests\Component\UtilityCode
public static function providerTestFilterBadProtocol() {
return [
[
'javascript://example.com?foo&bar',
'//example.com?foo&bar',
[
'http',
'https',
],
],
// Test custom protocols.
[
'http://example.com?foo&bar',
'//example.com?foo&bar',
[
'https',
],
],
// Valid protocol.
[
'http://example.com?foo&bar',
'http://example.com?foo&bar',
[
'https',
'http',
],
],
// Colon not part of the URL scheme.
[
'/test:8888?foo&bar',
'/test:8888?foo&bar',
[
'http',
],
],
];
}