You are here

function SearchByPagePathsRemoveTest::testSearchPages in Search by Page 8

Tests that pages can be searched.

File

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

Class

SearchByPagePathsRemoveTest
Functionality test for removing paths from Search by Page Paths.

Namespace

Drupal\Tests\search_by_page\Functional

Code

function testSearchPages() {

  // Privileged user - should see the one remaining page.
  $search_path = $this->envinfo1['page_path'];
  $this
    ->drupalLogin($this->privuser);
  $this
    ->drupalPostForm($search_path, array(
    'keys' => 'Trees',
  ), t('Search pages'));
  $this
    ->assertText('Trees', "Found Trees on the search results page");
  $this
    ->assertNoText('Pine', "Cannot see first deleted page in search results");
  $this
    ->assertNoText('Oak', "Cannot see second deleted page in search results");
  $this
    ->assertText('Orange', "Can see third page in search results");
}