You are here

function SecureSiteNameConflictFunctionalTest::testSecureSiteNameConflictUserEdit in Secure Site 6.2

Same name and namespace in other branches
  1. 7.2 securesite.test \SecureSiteNameConflictFunctionalTest::testSecureSiteNameConflictUserEdit()

Set user name to guest name.

File

./securesite.test, line 855
Tests for Secure Site module.

Class

SecureSiteNameConflictFunctionalTest
Functional tests for conflicts between guest name and user names.

Code

function testSecureSiteNameConflictUserEdit() {
  $this
    ->drupalLogin($this->user);
  $this
    ->drupalPost('user/' . $this->user->uid . '/edit', array(
    'name' => $this->guest,
  ), 'Save');
  $this
    ->assertText("The name {$this->guest} is being used as the " . variable_get('site_name', 'Drupal') . " guest name.", t('Setting user name to guest name.'));
  $this
    ->assertTrue(db_result(db_query_range("SELECT uid FROM {users} WHERE name = '%s'", $this->guest, 0, 1)) === FALSE, t('Checking for user with guest name.'));
}