You are here

public function SearchByPageAttachUploadsTest::makeContent in Search by Page 6

Makes 2 nodes with attachments, for search testing.

4 calls to SearchByPageAttachUploadsTest::makeContent()
SearchbyPageAttachCCK2Test::setUp in tests/search_by_page.test
Generates a random database prefix, runs the install scripts on the prefixed database and enable the specified modules. After installation many caches are flushed and the internal browser is setup so that the page requests will run on the new prefix.…
SearchByPageAttachCCKTest::setUp in tests/search_by_page.test
Generates a random database prefix, runs the install scripts on the prefixed database and enable the specified modules. After installation many caches are flushed and the internal browser is setup so that the page requests will run on the new prefix.…
SearchbyPageAttachUploads2Test::setUp in tests/search_by_page.test
Generates a random database prefix, runs the install scripts on the prefixed database and enable the specified modules. After installation many caches are flushed and the internal browser is setup so that the page requests will run on the new prefix.…
SearchByPageAttachUploadsTest::setUp in tests/search_by_page.test
Generates a random database prefix, runs the install scripts on the prefixed database and enable the specified modules. After installation many caches are flushed and the internal browser is setup so that the page requests will run on the new prefix.…
2 methods override SearchByPageAttachUploadsTest::makeContent()
SearchbyPageAttachNotReadable::makeContent in tests/search_by_page.test
Makes a node with an unreadable attachment, for search testing.
SearchbyPageAttachReindexTest::makeContent in tests/search_by_page.test
Makes several nodes with attachments, for search testing.

File

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

Class

SearchByPageAttachUploadsTest
Functionality test 1 for Search by Page Attachments with Uploads module.

Code

public function makeContent() {

  // Throw in a few nodes that won't match our tests.
  $info = array(
    'body' => 'blah',
    'teaser' => 'blah',
    'title' => 'blah',
  );
  $this
    ->drupalCreateNode($info);
  $this
    ->drupalCreateNode($info);
  $this
    ->drupalCreateNode($info);
  $this
    ->drupalCreateNode($info);
  $info = array(
    'title' => 'Favorite foods',
    'body' => 'I eat pizza every day.',
    'type' => 'sbp_indexed',
  );
  $node = $this
    ->drupalCreateNode($info);
  $this
    ->attachFileUpload($node, 'attach1.txt', TRUE, 'A very lonely file');
  $this
    ->attachFileUpload($node, 'attach2.txt', FALSE, 'A very happy file');
  $this
    ->attachFileUpload($node, 'attach5.TXT', TRUE, 'An upper-case file');
  $info = array(
    'title' => 'Favorite cars',
    'body' => 'I drive a hatchback.',
    'type' => 'sbp_hidden',
  );
  $node = $this
    ->drupalCreateNode($info);
  $this
    ->attachFileUpload($node, 'attach3.txt', TRUE, 'A very pretty file');

  // Configure Search Files API helpers
  $this
    ->drupalPost('admin/settings/search_files/helpers/autodetect', array(), t('Autodetect'));
  $this
    ->drupalGet('admin/settings/search_files/helpers/list');
  $this
    ->assertText('Text files', 'Text file helper for Search Files set up (without this, no file searching is possible)');
  $this
    ->assertText('Good', 'Safe mode message found (without this, no file searching is possible)');
}