You are here

function SearchbyPageAttach2Test::testSearchAttach in Search by Page 7

Tests that attachments are searched, and permissions.

Overrides SearchByPageAttachTest::testSearchAttach

File

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

Class

SearchbyPageAttach2Test
Functionality test 2 for Search by Page Attachments.

Code

function testSearchAttach() {
  $this
    ->drupalLogin($this->superuser);
  $search_path = $this->envinfo1['page_path'];

  // Search for the word 'flowers'
  $this
    ->drupalPost($search_path, array(
    'keys' => 'flowers',
  ), t('Search pages'));

  // Should find both listed attachments on the first node
  $this
    ->assertText('flowers', "Flowers appears in search results for flowers");
  $this
    ->assertText('daisy', "First attachment was found");
  $this
    ->assertText('snapdragon', "Second attachment was found");
  $this
    ->assertNoText('dahlia', "Third attachment was not found");
}