You are here

function SearchbyPageAttachNotReadable::testSearchAttach in Search by Page 7

Same name and namespace in other branches
  1. 6 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 SearchByPageAttachTest::testSearchAttach

File

tests/search_by_page.test, line 2604
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/config/search/settings');
  $this
    ->assertText('100% of the site has been indexed.');
  $this
    ->assertText('There are 0 items left to index.');
}