public function PageAccessTest::testAccessView in Page Manager 8
Same name and namespace in other branches
- 8.4 tests/src/Unit/PageAccessTest.php \Drupal\Tests\page_manager\Unit\PageAccessTest::testAccessView()
@covers ::checkAccess
File
- tests/
src/ Unit/ PageAccessTest.php, line 76 - Contains \Drupal\Tests\page_manager\Unit\PageAccessTest.
Class
- PageAccessTest
- Tests access for Page entities.
Namespace
Drupal\Tests\page_manager\UnitCode
public function testAccessView() {
$page = $this
->prophesize(PageInterface::class);
$page
->getContexts()
->willReturn([]);
$page
->getAccessConditions()
->willReturn([]);
$page
->getAccessLogic()
->willReturn('and');
$page
->status()
->willReturn(TRUE);
$page
->language()
->willReturn($this
->prophesize(LanguageInterface::class)
->reveal());
$page
->uuid()
->shouldBeCalled();
$page
->getEntityTypeId()
->shouldBeCalled();
$account = $this
->prophesize(AccountInterface::class);
$this
->assertTrue($this->pageAccess
->access($page
->reveal(), 'view', $account
->reveal()));
}