You are here

public function SitemapCssTest::testIncludeCssFile in Sitemap 8

Same name and namespace in other branches
  1. 8.2 src/Tests/SitemapCssTest.php \Drupal\sitemap\Tests\SitemapCssTest::testIncludeCssFile()
  2. 2.0.x src/Tests/SitemapCssTest.php \Drupal\sitemap\Tests\SitemapCssTest::testIncludeCssFile()

Tests include css file.

File

src/Tests/SitemapCssTest.php, line 38

Class

SitemapCssTest
Tests the inclusion of the sitemap css file based on sitemap settings.

Namespace

Drupal\sitemap\Tests

Code

public function testIncludeCssFile() {

  // Assert that css file is included by default.
  $this
    ->drupalGet('/sitemap');
  $this
    ->assertRaw('sitemap.theme.css');

  // Change module not to include css file.
  $edit = [
    'css' => FALSE,
  ];
  $this
    ->drupalPostForm('admin/config/search/sitemap', $edit, t('Save configuration'));

  // Assert that css file is not included.
  $this
    ->drupalGet('/sitemap');
  $this
    ->assertNoRaw('sitemap.theme.css');
}