You are here

public function LinkitsearchPluginUserTestCase::testDescription in Linkit 7.3

Test result description.

We just test one token.

File

test/linkit_search_plugin_user.test, line 101
Tests for Linkit search plugin user.

Class

LinkitsearchPluginUserTestCase
Test the the user search plugin.

Code

public function testDescription() {

  // We don't use the drupalCreateUser() as we want to set specific usernames.
  $user_1 = $this
    ->createUser(array(
    'name' => $this->search_string . $this
      ->randomName(),
  ));
  $user_2 = $this
    ->createUser(array(
    'name' => $this->search_string . $this
      ->randomName(),
  ));

  // Update the profile with a user result description.
  $this->_profile->data['entity:user']['result_description'] = 'Created [user:created:raw]';
  $this
    ->updateProfile();

  // Call the autocomplete helper method.
  $this
    ->autocompleteCall();

  // Check that the result description appers in the result.
  $this
    ->assertRaw('Created ' . $user_1->created, 'The result description was found in the result array.');
  $this
    ->assertRaw('Created ' . $user_2->created, 'The result description was found in the result array.');
}