You are here

function FileEntityAccessTestCase::assertFileEntityAccess in File Entity (fieldable files) 7.2

Same name and namespace in other branches
  1. 7.3 file_entity.test \FileEntityAccessTestCase::assertFileEntityAccess()

Asserts file_entity_access correctly grants or denies access.

1 call to FileEntityAccessTestCase::assertFileEntityAccess()
FileEntityAccessTestCase::testFileEntityAccess in ./file_entity.test
Runs basic tests for file_entity_access function.

File

./file_entity.test, line 1575
Test integration for the file_entity module.

Class

FileEntityAccessTestCase
Tests the file entity access API.

Code

function assertFileEntityAccess($ops, $file, $account) {
  drupal_static_reset('file_entity_access');
  foreach ($ops as $op => $result) {
    $msg = t("file_entity_access returns @result with operation '@op'.", array(
      '@result' => $result ? 'true' : 'false',
      '@op' => $op,
    ));
    $this
      ->assertEqual($result, file_entity_access($op, $file, $account), $msg);
  }
}