You are here

public function RealnameBasicTest::testRealnameUsernameAlter in Real Name 7

Test realname alter functions.

File

tests/realname.test, line 92
Test file for Realname module.

Class

RealnameBasicTest
Test basic functionality of Realname module.

Code

public function testRealnameUsernameAlter() {

  // Add a test string and see if core username has been replaced by realname.
  $edit['realname_pattern'] = '[user:name-raw] (UID: [user:uid])';
  $this
    ->drupalPost('admin/config/people/realname', $edit, t('Save configuration'));
  $this
    ->drupalGet('user/' . $this->admin_user->uid);
  $this
    ->assertRaw($this->admin_user->name . ' (UID: ' . $this->admin_user->uid . ')', '[testRealnameUsernameAlter]: Real name shown on user page.');
  $this
    ->drupalGet('user/' . $this->admin_user->uid . '/edit');
  $this
    ->assertRaw($this->admin_user->name . ' (UID: ' . $this->admin_user->uid . ')', '[testRealnameUsernameAlter]: Real name shown on user edit page.');
}