You are here

protected function oa_sectionsAccessBase::oaTestOaSectionAccessToSection in Open Atrium Core 7.2

Tests access to a specfic section.

Parameters

$space_text: Text to use for asserts.

$member_text: Text to use for asserts.

$section_text: Text to use for asserts.

$space: Space the section is part of.

$section: Section to test.

$account: Account to test access for.

$has_access: Whether $account should have access to this space.

1 call to oa_sectionsAccessBase::oaTestOaSectionAccessToSection()
oa_sectionsAccessBase::oaTestOaSectionAccess in modules/oa_sections/tests/oa_sectionsAccessBase.test
Tests access to sections.

File

modules/oa_sections/tests/oa_sectionsAccessBase.test, line 90
Base class for section access tests.

Class

oa_sectionsAccessBase
@file Base class for section access tests.

Code

protected function oaTestOaSectionAccessToSection($space_text, $member_text, $section_text, $space, $section, $account, $has_access) {
  if ($has_access) {
    $this
      ->assertTrue(node_access('view', $section, $account), t('@member has view access to @section section for @space', array(
      '@space' => $space_text,
      '@member' => $member_text,
      '@section' => $section_text,
    )));
  }
  else {
    $this
      ->assertFalse(node_access('view', $section, $account), t('@member does not have view access to @section section for @space', array(
      '@space' => $space_text,
      '@member' => $member_text,
      '@section' => $section_text,
    )));
  }
}