function UnroutedUrlTest::testCreateFromRequest
Same name in other branches
- 8.9.x core/tests/Drupal/Tests/Core/UnroutedUrlTest.php \Drupal\Tests\Core\UnroutedUrlTest::testCreateFromRequest()
- 10 core/tests/Drupal/Tests/Core/UnroutedUrlTest.php \Drupal\Tests\Core\UnroutedUrlTest::testCreateFromRequest()
- 11.x core/tests/Drupal/Tests/Core/UnroutedUrlTest.php \Drupal\Tests\Core\UnroutedUrlTest::testCreateFromRequest()
Tests the createFromRequest method.
@covers ::createFromRequest
File
-
core/
tests/ Drupal/ Tests/ Core/ UnroutedUrlTest.php, line 135
Class
- UnroutedUrlTest
- @coversDefaultClass \Drupal\Core\Url @group UrlTest
Namespace
Drupal\Tests\CoreCode
public function testCreateFromRequest() {
$request = Request::create('/test-path');
$this->router
->expects($this->once())
->method('matchRequest')
->with($request)
->will($this->throwException(new ResourceNotFoundException()));
$this->expectException(ResourceNotFoundException::class);
Url::createFromRequest($request);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.