You are here

public function LingotekAccessFunctionalTest::testTMVaultOverrideProjectAccess in Lingotek Translation 7.2

Same name and namespace in other branches
  1. 7.3 tests/lingotek.access.test \LingotekAccessFunctionalTest::testTMVaultOverrideProjectAccess()
  2. 7.4 tests/lingotek.access.test \LingotekAccessFunctionalTest::testTMVaultOverrideProjectAccess()

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

File

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

Class

LingotekAccessFunctionalTest
A class containing access control-related tests.

Code

public function testTMVaultOverrideProjectAccess() {
  $node_add_path = 'node/add/page';
  $test_text = 'id="edit-lingotek-vault-id"';

  // Privileged user can see the Lingotek Project override field.
  $this
    ->drupalLogin($this->privileged_user);
  $this
    ->drupalGet('node/add/page');
  $this
    ->assertText('Lingotek Translation Settings');
  $this
    ->drupalLogout();

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