You are here

protected function CustomFormattersTestCase::setCustomFormatter in Custom Formatters 7.2

Set a Custom Formatter to be used by a specified field/bundle/view mode.

Parameters

string $formatter_name: A Custom Formatter name.

string $field_name: A Field name.

string $bundle_name: A Node content type.

string $view_mode: A Node view mode.

3 calls to CustomFormattersTestCase::setCustomFormatter()
CustomFormattersGeneralTestCase::testCustomFormattersEngineFormatterPreset in tests/custom_formatters.general.test
Test the Formatter preset Engine.
CustomFormattersGeneralTestCase::testCustomFormattersEngineHtmlToken in tests/custom_formatters.general.test
Test the HTML + Token engine.
CustomFormattersGeneralTestCase::testCustomFormattersEnginePhp in tests/custom_formatters.general.test
Test the PHP Engine.

File

tests/custom_formatters.test, line 107
Tests for the Custom Formatters module.

Class

CustomFormattersTestCase
Class CustomFormattersTestCase.

Code

protected function setCustomFormatter($formatter_name, $field_name, $bundle_name, $view_mode = 'default') {
  $this
    ->drupalPost("admin/structure/types/manage/{$bundle_name}/display/{$view_mode}", array(
    "fields[{$field_name}][type]" => "custom_formatters_{$formatter_name}",
  ), t('Save'));
  $this
    ->assertText(t('Your settings have been saved.'));
}