You are here

protected function JuiceboxBaseCase::prepArticle in Juicebox HTML5 Responsive Image Galleries 7.2

Helper to turn the default instance of field_image on the article content type into a Juicebox display and create a test node that uses it.

5 calls to JuiceboxBaseCase::prepArticle()
JuiceboxConfCase::setUp in tests/JuiceboxConfCase.test
Define setup tasks.
JuiceboxConfGlobalCase::setUp in tests/JuiceboxConfGlobalCase.test
Define setup tasks.
JuiceboxFieldFormatterCase::setUp in tests/JuiceboxFieldFormatterCase.test
Define setup tasks.
JuiceboxSubRequestCase::setUp in tests/JuiceboxSubRequestCase.test
Define setup tasks.
JuiceboxViewsCase::setUp in tests/JuiceboxViewsCase.test
Define setup tasks.

File

tests/JuiceboxBaseCase.test, line 20
Common helper methods for Juicebox module tests.

Class

JuiceboxBaseCase
Common helper class for Juicebox module tests.

Code

protected function prepArticle() {

  // Get instance data for the existing article field_image field.
  $this->instance = field_info_instance('node', 'field_image', 'article');

  // Ensure that the title and alt fields are enabled for the default article
  // field_image field.
  $edit = array(
    'instance[settings][title_field]' => TRUE,
    'instance[settings][alt_field]' => TRUE,
  );
  $this
    ->drupalPost('admin/structure/types/manage/article/fields/field_image', $edit, t('Save settings'));

  // Create a new node with an image attached.
  $test_image = current($this
    ->drupalGetTestFiles('image'));
  $this->node = $this
    ->createNodeWithImage($this->instance, $test_image);
}