You are here

public function GeshiFilterTest::testTitleAttributeOnInlineCode in GeSHi Filter for syntax highlighting 8

Same name and namespace in other branches
  1. 8.2 tests/src/Functional/GeshiFilterTest.php \Drupal\Tests\geshifilter\Functional\GeshiFilterTest::testTitleAttributeOnInlineCode()

Test title attribute on inline code.

File

tests/src/Functional/GeshiFilterTest.php, line 478

Class

GeshiFilterTest
Tests for GeshiFilter in node content.

Namespace

Drupal\Tests\geshifilter\Functional

Code

public function testTitleAttributeOnInlineCode() {
  $source_code = "for (int i=0; i!=10; ++i) { fun(i); }";

  // No title set.
  $this
    ->assertGeshiFilterHighlighting('<code language="cpp">' . $source_code . '</code>', [
    [
      '<span class="geshifilter">',
      FALSE,
      0,
      0,
      0,
    ],
  ], t('Setting the title attritbute on inline code.'));

  // Title set.
  $this
    ->assertGeshiFilterHighlighting('<code language="cpp" title="Foo the bar!">' . $source_code . '</code>', [
    [
      '<span class="geshifilter" title="Foo the bar!">',
      FALSE,
      0,
      0,
      0,
    ],
  ], t('Setting the title attritbute on inline code.'));
}