function SearchbyPageAttachNotReadable::testSearchAttach in Search by Page 8
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/src/ Functional/ search_by_page.test, line 2294 
- Tests for the Search by Page module. By Jennifer Hodgdon of Poplar ProductivityWare, www.poplarware.com
Class
- SearchbyPageAttachNotReadable
- Tests attachments that cannot be read.
Namespace
Drupal\Tests\search_by_page\FunctionalCode
function testSearchAttach() {
  $this
    ->drupalLogin($this->superuser);
  $search_path = $this->envinfo2['page_path'];
  // Search for the word 'flowers' -- should find nothing.
  $this
    ->drupalPostForm($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.');
}