You are here

function GeshiFilterTest::testTitleAttributeOnCodeBlock in GeSHi Filter for syntax highlighting 7

Same name and namespace in other branches
  1. 6 geshifilter.test \GeshiFilterTest::testTitleAttributeOnCodeBlock()

File

./geshifilter.test, line 505
Tests for the GeSHi filter module.

Class

GeshiFilterTest
Funcional tests for the GeSHi filter node content.

Code

function testTitleAttributeOnCodeBlock() {
  $source_code = "for (int i=0; i!=10; ++i) {\n  fun(i);\n  bar.foo(x, y);\n}";

  // No title set
  $this
    ->assertGeshiFilterHighlighting('<code language="cpp">' . $source_code . '</code>', array(
    array(
      'geshifilter-title',
      False,
      0,
      0,
      0,
    ),
  ), t('Setting the title attritbute on code block.'), true);

  // Title set.
  $this
    ->assertGeshiFilterHighlighting('<code language="cpp" title="Foo the bar!">' . $source_code . '</code>', array(
    array(
      '<div class="geshifilter-title">Foo the bar!</div>',
      False,
      0,
      0,
      0,
    ),
  ), t('Setting the title attritbute on code block.'));
}