public function GeshiFilterTest::testSpecialChars in GeSHi Filter for syntax highlighting 7
Issue https://www.drupal.org/node/2047021.
File
- ./
geshifilter.test, line 558 - Tests for the GeSHi filter module.
Class
- GeshiFilterTest
- Funcional tests for the GeSHi filter node content.
Code
public function testSpecialChars() {
variable_set('geshifilter_tags', 'code');
variable_set('geshifilter_language_enabled_php', TRUE);
variable_set('geshifilter_decode_entities', TRUE);
$source = '<code language="php"><?php echo("<b>Hi</b>"); ?></code>';
// Create a node.
$edit = array(
'title' => 'Test for Custom Filter',
'body[und][0][value]' => $source,
'body[und][0][format]' => $this->input_format_id,
);
// Post node
$this
->drupalPost('node/add/page', $edit, t('Save'));
$this
->drupalGet('node/1');
// The same string must be on page, not double encoded.
$this
->assertRaw('"<b>Hi</b>"', 'The code is not double encoded.');
}