function FieldStorageConfigAccessControlHandlerTest::testAccess
Ensures field storage config access is working properly.
1 method overrides FieldStorageConfigAccessControlHandlerTest::testAccess()
- FieldConfigAccessControlHandlerTest::testAccess in core/
modules/ field/ tests/ src/ Unit/ FieldConfigAccessControlHandlerTest.php  - Ensures field config access is working properly.
 
File
- 
              core/
modules/ field/ tests/ src/ Unit/ FieldStorageConfigAccessControlHandlerTest.php, line 177  
Class
- FieldStorageConfigAccessControlHandlerTest
 - Tests the field storage config access controller.
 
Namespace
Drupal\Tests\field\UnitCode
public function testAccess() {
  $this->assertAllowOperations([], $this->anon);
  $this->assertAllowOperations([
    'view',
    'update',
    'delete',
  ], $this->member);
  $this->entity
    ->setLocked(TRUE)
    ->save();
  // Unfortunately, EntityAccessControlHandler has a static cache, which we
  // therefore must reset manually.
  $this->accessControlHandler
    ->resetCache();
  $this->assertAllowOperations([], $this->anon);
  $this->assertAllowOperations([
    'view',
    'update',
  ], $this->member);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.