You are here

public function XmlSitemapUnitTest::testAssertFlag in XML sitemap 8

Same name and namespace in other branches
  1. 2.x tests/src/Functional/XmlSitemapUnitTest.php \Drupal\Tests\xmlsitemap\Functional\XmlSitemapUnitTest::testAssertFlag()

Tests for xmlsitemap flags.

File

tests/src/Functional/XmlSitemapUnitTest.php, line 28

Class

XmlSitemapUnitTest
Unit tests for the XML sitemap module.

Namespace

Drupal\Tests\xmlsitemap\Functional

Code

public function testAssertFlag() {
  $this->state
    ->set('xmlsitemap_rebuild_needed', TRUE);
  $this
    ->assertTrue(xmlsitemap_var('xmlsitemap_rebuild_needed'));
  $this
    ->assertTrue($this
    ->assertFlag('xmlsitemap_rebuild_needed', TRUE, FALSE));
  $this
    ->assertTrue(xmlsitemap_var('xmlsitemap_rebuild_needed'));
  $this
    ->assertTrue($this
    ->assertFlag('xmlsitemap_rebuild_needed', TRUE, TRUE));
  $this
    ->assertFalse(xmlsitemap_var('xmlsitemap_rebuild_needed'));
  $this
    ->assertTrue($this
    ->assertFlag('xmlsitemap_rebuild_needed', FALSE, FALSE));
  $this
    ->assertFalse(xmlsitemap_var('xmlsitemap_rebuild_needed'));
}