You are here

public function UUIDTestHelper::uuidSettingsSet in Universally Unique IDentifier 6

Log in as administrator and change the settings using the admin settings form. After finishing the verification, return to previously logged in user.

Parameters

array $options:

  • associative array of options to be set in the settings form. Available options will match the settings form field names.
8 calls to UUIDTestHelper::uuidSettingsSet()
UUIDFunctionalityTestCase::testChangedSettingNodeUUID in ./uuid.test
Verify uuid behavior with changed settings. All settings are forced to disabled, then a node is created (with no UUID). Then settings are enabled, and the node is resaved, which should trigger UUIDs being created.
UUIDFunctionalityTestCase::testDisabledNodeUUID in ./uuid.test
Verify uuid behavior for nodes.
UUIDFunctionalityTestCase::testDisabledUserUUID in ./uuid.test
Verify uuid behavior for users.
UUIDFunctionalityTestCase::testEnabledNodeUUID in ./uuid.test
Verify uuid behavior for nodes.
UUIDFunctionalityTestCase::testEnabledNodeUUIDFormEdit in ./uuid.test
Verify uuid behavior when edititng via node form. http://drupal.org/node/1065364

... See full list

File

./uuid.test, line 41
Functionality tests for UUID module.

Class

UUIDTestHelper
Helper test class with some added functions for testing.

Code

public function uuidSettingsSet($options) {
  $loggedin = $this->loggedInUser;

  // Login as an administration user with permissions to configure the module.
  $admin = $this
    ->drupalCreateUser(array(
    'administer content types',
  ));
  $this
    ->drupalLogin($admin);

  // Submit the settings form with new settings.
  $this
    ->drupalPost('admin/settings/uuid', $options, t('Save configuration'));
  foreach ($options as $name => $value) {
    $this
      ->assertFieldByName($name, $value, t("Field %name successfully verified.", array(
      '%name' => $name,
    )), t("Settings form"));
  }

  // Logout and set back previously logged in user.
  if ($loggedin) {
    $this
      ->drupalLogin($loggedin);
  }
  else {
    $this
      ->drupalLogout();
  }
}