You are here

function SearchbyPageAttachNotReadable::testSearchAttach in Search by Page 6

Same name and namespace in other branches
  1. 7 tests/search_by_page.test \SearchbyPageAttachNotReadable::testSearchAttach()

Tests that attachments with unreadable text are handled OK.

They shouldn't appear in search results, but they shouldn't screw up search indexing.

Overrides SearchByPageAttachCCKTest::testSearchAttach

File

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

Class

SearchbyPageAttachNotReadable
Tests attachments that cannot be read.

Code

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

  // Search for the word 'flowers' -- should find nothing.
  $this
    ->drupalPost($search_path, array(
    'keys' => 'flowers',
  ), t('Search pages'));
  $this
    ->assertNoText('flowers', "Flowers does not appear in search results for flowers");

  // Search indexing should show 100%.
  $this
    ->drupalGet('admin/settings/search');
  $this
    ->assertText('100% of the site has been indexed.');
  $this
    ->assertText('There are 0 items left to index.');
}