You are here

public function RoleDelegationOperationsTestCase::testOperationsExist in Role Delegation 7

Check that the right combination of Add and Remove role operations is present in the user bulk update form.

File

./role_delegation.test, line 215
Tests for the Role Delegation module.

Class

RoleDelegationOperationsTestCase
Functional tests for operations.

Code

public function testOperationsExist() {
  $this
    ->drupalLogin($this->user_high);
  $this
    ->drupalGet('admin/people');
  $this
    ->assertFieldByXPath('//select[@name="operation"]//option', "role_delegation_add_role-{$this->rid_low}", t("!user user can use Add !role role operation.", array(
    '!user' => 'High',
    '!role' => 'low',
  )), t('Role Delegation'));
  $this
    ->assertFieldByXPath('//select[@name="operation"]//option', "role_delegation_remove_role-{$this->rid_low}", t("!user user can use Remove !role role operation.", array(
    '!user' => 'High',
    '!role' => 'low',
  )), t('Role Delegation'));
  $this
    ->assertNoFieldByXPath('//select[@name="operation"]//option', "role_delegation_add_role-{$this->rid_high}", t("!user user can't use Add !role role operation.", array(
    '!user' => 'High',
    '!role' => 'high',
  )), t('Role Delegation'));
  $this
    ->assertNoFieldByXPath('//select[@name="operation"]//option', "role_delegation_remove_role-{$this->rid_high}", t("!user user can't use Remove !role role operation.", array(
    '!user' => 'High',
    '!role' => 'high',
  )), t('Role Delegation'));
}