summaryrefslogtreecommitdiffstats
path: root/core/tests/Drupal/Tests/Core/Utility/UnroutedUrlAssemblerTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'core/tests/Drupal/Tests/Core/Utility/UnroutedUrlAssemblerTest.php')
-rw-r--r--core/tests/Drupal/Tests/Core/Utility/UnroutedUrlAssemblerTest.php10
1 files changed, 10 insertions, 0 deletions
diff --git a/core/tests/Drupal/Tests/Core/Utility/UnroutedUrlAssemblerTest.php b/core/tests/Drupal/Tests/Core/Utility/UnroutedUrlAssemblerTest.php
index 6f5401f..6a3642a 100644
--- a/core/tests/Drupal/Tests/Core/Utility/UnroutedUrlAssemblerTest.php
+++ b/core/tests/Drupal/Tests/Core/Utility/UnroutedUrlAssemblerTest.php
@@ -68,6 +68,14 @@ class UnroutedUrlAssemblerTest extends UnitTestCase {
/**
* @covers ::assemble
+ * @expectedException \InvalidArgumentException
+ */
+ public function testAssembleWithLeadingSlash() {
+ $this->unroutedUrlAssembler->assemble('/drupal.org');
+ }
+
+ /**
+ * @covers ::assemble
* @covers ::buildExternalUrl
*
* @dataProvider providerTestAssembleWithExternalUrl
@@ -89,6 +97,7 @@ class UnroutedUrlAssemblerTest extends UnitTestCase {
['http://example.com/test', ['https' => TRUE], 'https://example.com/test'],
['https://example.com/test', ['https' => FALSE], 'http://example.com/test'],
['https://example.com/test?foo=1#bar', [], 'https://example.com/test?foo=1#bar'],
+ ['//drupal.org', [], '//drupal.org'],
];
}
@@ -115,6 +124,7 @@ class UnroutedUrlAssemblerTest extends UnitTestCase {
['base:example', [], TRUE, '/subdir/example'],
['base:example', ['query' => ['foo' => 'bar']], TRUE, '/subdir/example?foo=bar'],
['base:example', ['fragment' => 'example', ], TRUE, '/subdir/example#example'],
+ ['base:/drupal.org', [], FALSE, '/drupal.org'],
];
}