You are here

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

Helper to activate a Juicebox field formatter on a field.

Parameters

array $instance: The instance details, typically from field_info_instance(), that describe the field to activate the formatter on.

6 calls to JuiceboxBaseCase::activateJuiceboxFieldFormatter()
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.
JuiceboxFileCase::testFile in tests/JuiceboxFileCase.test
Test the field formatter with a file field and file upload widget.
JuiceboxFileCase::testFileNonImage in tests/JuiceboxFileCase.test
Test the non-image handling feature.

... See full list

File

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

Class

JuiceboxBaseCase
Common helper class for Juicebox module tests.

Code

protected function activateJuiceboxFieldFormatter($instance) {
  $this
    ->drupalGet('admin/structure/types/manage/' . $instance['bundle'] . '/display');
  $edit = array(
    'fields[' . $instance['field_name'] . '][type]' => 'juicebox_formatter',
  );
  $this
    ->drupalPost(NULL, $edit, t('Save'));
  $this
    ->assertText(t('Your settings have been saved.'), 'Juicebox field formatter activated.');
}