You are here

public function PanelizerFieldPanelsStorageTest::testAccessNoEntity in Panelizer 8.3

Same name and namespace in other branches
  1. 8.5 tests/src/Unit/PanelizerFieldPanelsStorageTest.php \Drupal\Tests\panelizer\Unit\PanelizerFieldPanelsStorageTest::testAccessNoEntity()
  2. 8.4 tests/src/Unit/PanelizerFieldPanelsStorageTest.php \Drupal\Tests\panelizer\Unit\PanelizerFieldPanelsStorageTest::testAccessNoEntity()

@covers ::access

File

tests/src/Unit/PanelizerFieldPanelsStorageTest.php, line 223

Class

PanelizerFieldPanelsStorageTest
Tests the PanelizerFieldPanelsStorage service.

Namespace

Drupal\Tests\panelizer\Unit

Code

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()));
}