You are here

public function LingotekAccessFunctionalTest::testProjectOverrideProjectAccess in Lingotek Translation 7.5

Same name and namespace in other branches
  1. 7.7 tests/lingotek.access.test \LingotekAccessFunctionalTest::testProjectOverrideProjectAccess()
  2. 7.2 tests/lingotek.access.test \LingotekAccessFunctionalTest::testProjectOverrideProjectAccess()
  3. 7.3 tests/lingotek.access.test \LingotekAccessFunctionalTest::testProjectOverrideProjectAccess()
  4. 7.4 tests/lingotek.access.test \LingotekAccessFunctionalTest::testProjectOverrideProjectAccess()
  5. 7.6 tests/lingotek.access.test \LingotekAccessFunctionalTest::testProjectOverrideProjectAccess()

Tests field access for the Lingotek project override field on node/add forms.

File

tests/lingotek.access.test, line 26
Declares LingotekAccessFunctionalTest

Class

LingotekAccessFunctionalTest
A class containing access control-related tests.

Code

public function testProjectOverrideProjectAccess() {
  $node_add_path = 'node/add/page';
  $lingotek_html = 'id="edit-lingotek-profile"';

  // Privileged user can see the Lingotek Project override field.
  $this
    ->drupalLogin($this->privileged_user);
  $this
    ->drupalGet($node_add_path);
  $this
    ->assertRaw($lingotek_html);
  $this
    ->drupalLogout();

  // Unprivileged user cannot see the field.
  $this
    ->drupalLogin($this->unprivileged_user);
  $this
    ->drupalGet($node_add_path);
  $this
    ->assertNoRaw($lingotek_html);
  $this
    ->drupalLogout();
}