You are here

function SearchByPagePathsTest::testSearchExclusions in Search by Page 7

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

Tests that the text in the excluded tag is actually excluded.

File

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

Class

SearchByPagePathsTest
Functionality tests for Search by Page Paths.

Code

function testSearchExclusions() {
  $search_path = $this->envinfo1['page_path'];
  $this
    ->drupalLogin($this->noprivuser);
  $this
    ->drupalPost($search_path, array(
    'keys' => 'Trees',
  ), t('Search pages'));
  $this
    ->assertNoText('Poplar', "Excluded text is not shown in search for Trees");
  $this
    ->assertText('Cottonwood', "Non-excluded text is shown in search for Trees");
  $this
    ->drupalPost($search_path, array(
    'keys' => 'Poplar',
  ), t('Search pages'));
  $this
    ->assertNoText('Poplar', "Excluded text is not shown in search for excluded text");
  $this
    ->assertNoText('Trees', "Trees is not shown in search for excluded text");
  $this
    ->assertNoText('Cottonwood', "Non-excluded text is not shown in search for excluded text");
}