public function FieldBlockTest::testBlockAccessEntityAllowedNotFieldable in Drupal 8
Same name and namespace in other branches
- 9 core/modules/layout_builder/tests/src/Kernel/FieldBlockTest.php \Drupal\Tests\layout_builder\Kernel\FieldBlockTest::testBlockAccessEntityAllowedNotFieldable()
- 10 core/modules/layout_builder/tests/src/Kernel/FieldBlockTest.php \Drupal\Tests\layout_builder\Kernel\FieldBlockTest::testBlockAccessEntityAllowedNotFieldable()
Tests unfieldable entity.
@covers ::blockAccess
File
- core/
modules/ layout_builder/ tests/ src/ Kernel/ FieldBlockTest.php, line 96
Class
- FieldBlockTest
- @coversDefaultClass \Drupal\layout_builder\Plugin\Block\FieldBlock @group Field
Namespace
Drupal\Tests\layout_builder\KernelCode
public function testBlockAccessEntityAllowedNotFieldable() {
$entity = $this
->prophesize(EntityInterface::class);
$block = $this
->getTestBlock($entity);
$account = $this
->prophesize(AccountInterface::class);
$entity
->access('view', $account
->reveal(), TRUE)
->willReturn(AccessResult::allowed());
$access = $block
->access($account
->reveal(), TRUE);
$this
->assertSame(FALSE, $access
->isAllowed());
}