You are here

function SearchByPagePathsNodesTest::testSearchPages in Search by Page 8

Tests that pages can be searched.

File

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

Class

SearchByPagePathsNodesTest
Tests for Search by Page Paths - searching nodes.

Namespace

Drupal\Tests\search_by_page\Functional

Code

function testSearchPages() {

  // Search for 'walk' - should find both pages
  $search_path = $this->envinfo2['page_path'];
  $this
    ->drupalLogin($this->superuser);
  $this
    ->drupalPostForm($search_path, array(
    'keys' => 'walk',
  ), t('Search pages'));
  $this
    ->assertText('walk', "Walk appears in search results for walk");
  $this
    ->assertText('streets', "First page was found");
  $this
    ->assertText('north', "Second page was found");
}