You are here

public function QuickEditEntityFieldAccessCheckTest::testAccessForbidden in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/quickedit/tests/src/Unit/Access/QuickEditEntityFieldAccessCheckTest.php \Drupal\Tests\quickedit\Unit\Access\QuickEditEntityFieldAccessCheckTest::testAccessForbidden()

Tests checking access to routes that result in AccessResult::isForbidden().

@dataProvider providerTestAccessForbidden

File

core/modules/quickedit/tests/src/Unit/Access/QuickEditEntityFieldAccessCheckTest.php, line 101

Class

QuickEditEntityFieldAccessCheckTest
@coversDefaultClass \Drupal\quickedit\Access\QuickEditEntityFieldAccessCheck @group Access @group quickedit

Namespace

Drupal\Tests\quickedit\Unit\Access

Code

public function testAccessForbidden($field_name, $langcode) {
  $account = $this
    ->createMock('Drupal\\Core\\Session\\AccountInterface');
  $entity = $this
    ->createMockEntity();
  $this
    ->assertEquals(AccessResult::forbidden(), $this->editAccessCheck
    ->access($entity, $field_name, $langcode, $account));
}