public function GeshiFilterCssTest::testCssInline in GeSHi Filter for syntax highlighting 8.2
Same name and namespace in other branches
- 8 tests/src/Functional/GeshiFilterCssTest.php \Drupal\Tests\geshifilter\Functional\GeshiFilterCssTest::testCssInline()
Test the use of css when CSS mode for syntax highlighting is inline.
In this case we have geshifilter.css and no geshi-languages.css.
File
- tests/
src/ Functional/ GeshiFilterCssTest.php, line 103
Class
- GeshiFilterCssTest
- Test for css generation and use in GeshiFilter.
Namespace
Drupal\Tests\geshifilter\FunctionalCode
public function testCssInline() {
// Node Content.
$node = [
'title' => 'Test for GeShi Filter',
'body' => [
[
'value' => "dfgdfg <code language=\"php\">echo(\"hi\");</code> dfgdg",
'format' => 'geshifilter_text_format',
],
],
'type' => 'geshifilter_content_type',
];
// Inline CSS.
$form_values = [
'css_mode' => 1,
];
$this
->drupalPostForm('admin/config/content/formats/geshifilter', $form_values, t('Save configuration'));
// Create the node and read it.
$this
->drupalCreateNode($node);
$this
->drupalGet('node/1');
// Test if we have only geshifilter.css.
$this
->assertRaw('/assets/css/geshifilter.css', 'The CSS file /assets/css/geshifilter.css is present.');
$this
->assertNoRaw('/geshi/geshifilter-languages.css', 'The CSS file /geshi/geshifilter-languages.css is present.');
}