function GeshiFilterTest::testDoNothingMode in GeSHi Filter for syntax highlighting 6
Same name and namespace in other branches
- 7 geshifilter.test \GeshiFilterTest::testDoNothingMode()
File
- ./geshifilter.test, line 479
- Tests for the GeSHi filter module.
Class
- GeshiFilterTest
Code
function testDoNothingMode() {
variable_set('geshifilter_language_enabled_cpp', TRUE);
variable_set('geshifilter_language_tags_cpp', 'cpp');
variable_set('geshifilter_default_highlighting', GESHIFILTER_DEFAULT_DONOTHING);
$source_code = "//C++-ish source code\nfor (int i=0; i!=10; ++i) {\n fun(i);\n bar.foo(x, y);\n}";
$this
->assertGeshiFilterHighlighting('<code>' . $source_code . '</code>', array(
array(
'<code>' . $source_code . '</code>',
FALSE,
0,
1,
FALSE,
),
), t('Do nothing mode should not touch given source code'));
$this
->assertGeshiFilterHighlighting('<code language="cpp">' . $source_code . '</code>', array(
array(
$source_code,
'cpp',
0,
1,
FALSE,
),
), t('Highlighting with language="cpp" should work when default is "do nothing"'));
$this
->assertGeshiFilterHighlighting('<cpp>' . $source_code . '</cpp>', array(
array(
$source_code,
'cpp',
0,
1,
FALSE,
),
), t('Highlighting with <cpp>...</cpp> should work when default is "do nothing"'));
}