public function UrlTest::testAccessRouted in Drupal 8
Tests the access() method for routed URLs.
@covers ::access @covers ::accessManager @dataProvider accessProvider
Parameters
bool $access:
File
- core/
tests/ Drupal/ Tests/ Core/ UrlTest.php, line 503 - Contains \Drupal\Tests\Core\UrlTest.
Class
- UrlTest
- @coversDefaultClass \Drupal\Core\Url @group UrlTest
Namespace
Drupal\Tests\CoreCode
public function testAccessRouted($access) {
$account = $this
->createMock('Drupal\\Core\\Session\\AccountInterface');
$url = new TestUrl('entity.node.canonical', [
'node' => 3,
]);
$url
->setAccessManager($this
->getMockAccessManager($access, $account));
$this
->assertEquals($access, $url
->access($account));
}