You are here

public function LinkitsearchPluginUserTestCase::testBasicResults in Linkit 7.3

Test that we get results back which is valid.

File

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

Class

LinkitsearchPluginUserTestCase
Test the the user search plugin.

Code

public function testBasicResults() {

  // 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(),
  ));
  $user_3 = $this
    ->createUser(array(
    'name' => $this->search_string . $this
      ->randomName(),
  ));

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

  // Check that the usernames appears in the response.
  $this
    ->assertRaw($user_1->name, 'Username was found in the result array.');
  $this
    ->assertRaw($user_2->name, 'Username was found in the result array.');
  $this
    ->assertRaw($user_3->name, 'Username was found in the result array.');
}