You are here

public function SiteMapCssTest::testIncludeCssFile in Site map 8

Tests include css file.

File

src/Tests/SiteMapCssTest.php, line 38

Class

SiteMapCssTest
Test case class for site map css file tests.

Namespace

Drupal\site_map\Tests

Code

public function testIncludeCssFile() {

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

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

  // Clearing the cache is needed for the test.
  $this
    ->drupalPostForm('admin/config/development/performance', array(), 'Clear all caches');

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