function GeshiFilterTest::testSpecialTags in GeSHi Filter for syntax highlighting 7
Same name and namespace in other branches
- 5.2 tests/geshifilter.test \GeshiFilterTest::testSpecialTags()
- 6 geshifilter.test \GeshiFilterTest::testSpecialTags()
Check if tags like [c++] and [c#] work Problem described in http://drupal.org/node/208720
File
- ./
geshifilter.test, line 442 - Tests for the GeSHi filter module.
Class
- GeshiFilterTest
- Funcional tests for the GeSHi filter node content.
Code
function testSpecialTags() {
// Enabled the tags
variable_set('geshifilter_language_enabled_cpp', TRUE);
variable_set('geshifilter_language_tags_cpp', 'c++');
variable_set('geshifilter_language_enabled_csharp', TRUE);
variable_set('geshifilter_language_tags_csharp', 'c#');
// body material
$source_code = "//C++-ish source code\nfor (int i=0; i<10; ++i) {\n fun(i);\n bar.foo(x, y);\n server->start(&pool); \n}";
// Test the tags
$this
->assertGeshiFilterHighlighting('<c++>' . $source_code . '</c++>', array(
array(
$source_code,
'cpp',
0,
1,
FALSE,
),
), t('Checking <c++>..</c++>'));
$this
->assertGeshiFilterHighlighting('<c#>' . $source_code . '</c#>', array(
array(
$source_code,
'csharp',
0,
1,
FALSE,
),
), t('Checking <c#>..</c#>'));
}