function SearchByPageOutputTest::testSearchPages in Search by Page 7
Same name and namespace in other branches
- 6 tests/search_by_page.test \SearchByPageOutputTest::testSearchPages()
Tests that pages can be searched.
File
- tests/
search_by_page.test, line 2901 - Tests for the Search by Page module. By Jennifer Hodgdon of Poplar ProductivityWare, www.poplarware.com
Class
- SearchByPageOutputTest
- Tests that Search by Page doesn't get fooled by page output.
Code
function testSearchPages() {
// Search and verify that the word "wrong" doesn't appear on the page.
// It would appear if some of the bad output got through. Also make
// sure that the correct output does appear.
$search_path = $this->envinfo1['page_path'];
$this
->drupalLogin($this->superuser);
$this
->drupalPost($search_path, array(
'keys' => 'Trees',
), t('Search pages'));
$this
->assertText('Trees', "Found Trees on the search results page");
$this
->assertText('Apple', "Found Apple on the search results page");
$this
->assertNoText('Wrong', "Bad output did not make it to the results page");
}