public function CustomFormattersTestCase::assertCustomFormatterExists in Custom Formatters 7.2
Pass if the Custom Formatter is found.
Parameters
string $name: The name of the formatter to check.
string $message: Message to display.
string $group: The group this message belong to, default to 'Other'.
Return value
bool TRUE on pass, FALSE on fail.
1 call to CustomFormattersTestCase::assertCustomFormatterExists()
- CustomFormattersGeneralTestCase::testCustomFormattersUi in tests/
custom_formatters.general.test - Test General UI related functionality.
File
- tests/
custom_formatters.test, line 54 - Tests for the Custom Formatters module.
Class
- CustomFormattersTestCase
- Class CustomFormattersTestCase.
Code
public function assertCustomFormatterExists($name, $message = '', $group = 'Other') {
$formatter = custom_formatters_crud_load($name);
$message = empty($message) ? $message : t('Custom Formatter %name found.', array(
'%name' => $name,
));
return $this
->assert(!is_null($formatter), $message, $group);
}