You are here

function FileEntityAccessTest::setUp in File Entity (fieldable files) 8.2

Overrides FileEntityTestBase::setUp

File

tests/src/Functional/FileEntityAccessTest.php, line 31

Class

FileEntityAccessTest
Tests the access aspects of file entity.

Namespace

Drupal\Tests\file_entity\Functional

Code

function setUp() {
  parent::setUp();
  $this
    ->setUpFiles(array(
    'uid' => 0,
  ));
  $this->accessControlHandler = $this->container
    ->get('entity_type.manager')
    ->getAccessControlHandler('file');

  // Unset the fact that file_entity_install() adds the 'view files'
  // permission to all user roles. This messes with being able to fully unit
  // test the file_entity_access() function.
  $roles = user_roles();
  foreach ($roles as $rid => $role) {
    user_role_revoke_permissions($rid, array(
      'view files',
    ));
  }
}