public function PanelizerFieldPanelsStorageTest::testAccessNoEntity in Panelizer 8.4
Same name and namespace in other branches
- 8.5 tests/src/Unit/PanelizerFieldPanelsStorageTest.php \Drupal\Tests\panelizer\Unit\PanelizerFieldPanelsStorageTest::testAccessNoEntity()
- 8.3 tests/src/Unit/PanelizerFieldPanelsStorageTest.php \Drupal\Tests\panelizer\Unit\PanelizerFieldPanelsStorageTest::testAccessNoEntity()
@covers ::access
File
- tests/
src/ Unit/ PanelizerFieldPanelsStorageTest.php, line 221
Class
- PanelizerFieldPanelsStorageTest
- Tests the PanelizerFieldPanelsStorage service.
Namespace
Drupal\Tests\panelizer\UnitCode
public function testAccessNoEntity() {
$account = $this
->prophesize(AccountInterface::class);
$this->storage
->load('123')
->willReturn(NULL)
->shouldBeCalled();
$this->panelizer
->getPanelsDisplay()
->shouldNotBeCalled();
$this
->assertEquals(AccessResult::forbidden(), $this->panelsStorage
->access('entity_type_id:123:view_mode', 'read', $account
->reveal()));
}