1.20.x file.test FileAccessTestCase::assertFileAccess($ops, $file, $account)

Asserts file_access correctly grants or denies access.

File

modules/file/tests/file.test, line 3239
Tests for file.module.

Class

FileAccessTestCase
Tests the file entity access API.

Code

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