You are here

public function DuplicatesTermMergeWebTestCase::testDisabledAndPermissions in Term Merge 7

Test access rights.

File

./term_merge.test, line 858
Test the Term Merge module.

Class

DuplicatesTermMergeWebTestCase
Test the Merge Duplicate Terms feature of the Term Merge module.

Code

public function testDisabledAndPermissions() {

  // Trying a user who doesn't have enough permissions.
  $account = $this
    ->drupalCreateUser();
  $this
    ->drupalLogin($account);
  $this
    ->drupalGet('admin/structure/taxonomy/' . $this->vocabulary->machine_name . '/merge/duplicates');
  $this
    ->assertResponse(403, 'Access to Merge Duplicate Terms is denied for a user who does not have enough permissions.');

  // Trying a user who have enough permissions.
  $this
    ->drupalLogin($this->admin);
  $this
    ->drupalGet('admin/structure/taxonomy/' . $this->vocabulary->machine_name . '/merge/duplicates');
  $this
    ->assertResponse(200, 'Access to Merge Duplicate Terms is granted for a user who has enough permissions.');
}