function FieldBlockTest::testBlockAccessEntityAllowedNotFieldable
Same name and namespace in other branches
- 9 core/modules/layout_builder/tests/src/Kernel/FieldBlockTest.php \Drupal\Tests\layout_builder\Kernel\FieldBlockTest::testBlockAccessEntityAllowedNotFieldable()
- 8.9.x 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 98
Class
- FieldBlockTest
- @coversDefaultClass <a href="/api/drupal/core%21modules%21layout_builder%21src%21Plugin%21Block%21FieldBlock.php/class/FieldBlock/11.x" title="Provides a block that renders a field from an entity." class="local">\Drupal\layout_builder\Plugin\Block\FieldBlock</a> @group Field
Namespace
Drupal\Tests\layout_builder\KernelCode
public function testBlockAccessEntityAllowedNotFieldable() : void {
$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->assertFalse($access->isAllowed());
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.