You are here

function SearchbyPageAttachUploads2Test::testSearchAttach in Search by Page 6

Tests that attachments are searched, and permissions.

Overrides SearchByPageAttachUploadsTest::testSearchAttach

File

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

Class

SearchbyPageAttachUploads2Test
Functionality test 2 for Search by Page Attachments with Uploads module.

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");
}