function QuickEditEntityFieldAccessCheckTest::testAccessForbidden

Same name 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));
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.