class UrlAlterTest
Same name and namespace in other branches
- 11.x core/tests/Drupal/KernelTests/Core/Path/UrlAlterTest.php \Drupal\KernelTests\Core\Path\UrlAlterTest
- 10 core/tests/Drupal/KernelTests/Core/Path/UrlAlterTest.php \Drupal\KernelTests\Core\Path\UrlAlterTest
- 8.9.x core/tests/Drupal/KernelTests/Core/Path/UrlAlterTest.php \Drupal\KernelTests\Core\Path\UrlAlterTest
Tests the capability to alter URLs.
@group Path
Hierarchy
- class \Drupal\KernelTests\KernelTestBase implements \Drupal\Core\DependencyInjection\ServiceProviderInterface uses \Drupal\KernelTests\AssertLegacyTrait, \Drupal\KernelTests\AssertContentTrait, \Drupal\Tests\RandomGeneratorTrait, \Drupal\Tests\ConfigTestTrait, \Drupal\Tests\ExtensionListTestTrait, \Drupal\Tests\TestRequirementsTrait, \Drupal\Tests\Traits\PhpUnitWarnings, \Drupal\Tests\PhpUnitCompatibilityTrait, \Symfony\Bridge\PhpUnit\ExpectDeprecationTrait extends \PHPUnit\Framework\TestCase
- class \Drupal\KernelTests\Core\Path\UrlAlterTest extends \Drupal\KernelTests\KernelTestBase
Expanded class hierarchy of UrlAlterTest
See also
\Drupal\Core\Routing\UrlGenerator::processPath
File
-
core/
tests/ Drupal/ KernelTests/ Core/ Path/ UrlAlterTest.php, line 15
Namespace
Drupal\KernelTests\Core\PathView source
class UrlAlterTest extends KernelTestBase {
/**
* {@inheritdoc}
*/
protected static $modules = [
'path',
'url_alter_test',
'user',
];
public function testUrlWithQueryString() {
// Test outbound query string altering.
$url = Url::fromRoute('user.login');
$this->assertEquals(\Drupal::request()->getBaseUrl() . '/user/login?foo=bar', $url->toString());
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.