You are here

SitemapCssTest.php in Sitemap 2.0.x

Same filename and directory in other branches
  1. 8.2 src/Tests/SitemapCssTest.php
  2. 8 src/Tests/SitemapCssTest.php

File

src/Tests/SitemapCssTest.php
View source
<?php

namespace Drupal\sitemap\Tests;


/**
 * Tests the inclusion of the sitemap css file based on sitemap settings.
 *
 * @group sitemap
 */
class SitemapCssTest extends SitemapTestBase {

  /**
   * {@inheritdoc}
   */
  protected function setUp() {
    parent::setUp();
    $this
      ->drupalLogin($this->userAdmin);
  }

  /**
   * Tests include css file.
   */
  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.
    $this
      ->saveSitemapForm([
      'include_css' => FALSE,
    ]);
    drupal_flush_all_caches();

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

}

Classes

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