1 user.test UserEntityCallbacksTestCase::testLabelCallback()

Test label callback.

File

core/modules/user/tests/user.test, line 2445
Tests for user.module.

Class

UserEntityCallbacksTestCase
Test user entity callbacks.

Code

function testLabelCallback() {
  $this->assertEqual(entity_label('user', $this->account), $this->account->name, t('The username should be used as label'));

  // Setup a random anonymous name to be sure the name is used.
  $name = $this->randomName();
  config_set('system.core', 'anonymous', $name);
  $this->assertEqual(entity_label('user', $this->anonymous), $name, t('The variable anonymous should be used for name of uid 0'));
}