public function CustomFormattersGeneralTestCase::testCustomFormattersEnginePhp in Custom Formatters 7.2
Test the PHP Engine.
File
- tests/
custom_formatters.general.test, line 102 - Tests for the Custom Fomratters module.
Class
- CustomFormattersGeneralTestCase
- Class FileFieldPathsGeneralTestCase.
Code
public function testCustomFormattersEnginePhp() {
// Create a Custom formatter.
$text = $this
->randomName();
$this->formatter = $this
->createCustomFormatter(array(
'mode' => 'php',
'code' => "return '{$text}';",
));
// Set the formatter active on the Body field.
$this
->setCustomFormatter($this->formatter->name, 'body', 'article');
// Ensure Formatter rendered correctly.
$this
->drupalGet("node/{$this->node->nid}");
$this
->assertText($text, t('Custom formatter output found.'));
}