You are here

function SearchByPageUsersTest::testSearchUsers in Search by Page 7

Same name and namespace in other branches
  1. 6 tests/search_by_page.test \SearchByPageUsersTest::testSearchUsers()

Tests that users can be searched.

File

tests/search_by_page.test, line 1139
Tests for the Search by Page module. By Jennifer Hodgdon of Poplar ProductivityWare, www.poplarware.com

Class

SearchByPageUsersTest
Functionality tests for Search by Page Users.

Code

function testSearchUsers() {

  // Search for user a
  $search_path = $this->envinfo2['page_path'];
  $this
    ->drupalLogin($this->superuser);
  $this
    ->drupalPost($search_path, array(
    'keys' => $this->usera->name,
  ), t('Search pages'));

  // Verify we found user a
  $this
    ->assertText($this->usera->name, "User a appears in search results");
  $this
    ->assertLink($this->usera->name, 0, "Link to user a appears in search results");

  // Search for user b
  $this
    ->drupalPost($search_path, array(
    'keys' => $this->userb->name,
  ), t('Search pages'));

  // Verify we did not find user b, and have "no results"
  $this
    ->assertNoText($this->userb->name, "User b does not appear in search results");
  $this
    ->assertText('no results', "No results appears on search results page for user b");
}