You are here

public function EntityMetadataTaxonomyAccessTestCase::assertTaxonomyMetadataAccess in Entity API 7

Asserts entity_access() correctly grants or denies access.

1 call to EntityMetadataTaxonomyAccessTestCase::assertTaxonomyMetadataAccess()
EntityMetadataTaxonomyAccessTestCase::testTaxonomyMetadataAccess in ./entity.test
Runs basic tests for entity_access() function.

File

./entity.test, line 1370
Entity CRUD API tests.

Class

EntityMetadataTaxonomyAccessTestCase
Tests basic entity_access() functionality for taxonomy terms.

Code

public function assertTaxonomyMetadataAccess($ops, $term, $account) {
  foreach ($ops as $op => $result) {
    $msg = t("entity_access() returns @result with operation '@op'.", array(
      '@result' => $result ? 'TRUE' : 'FALSE',
      '@op' => $op,
    ));
    $access = entity_access($op, 'taxonomy_term', $term, $account);
    $this
      ->assertEqual($result, $access, $msg);
  }
}