You are here

public function XmlSitemapWriterTest::testInvalidPage in XML sitemap 8

Same name and namespace in other branches
  1. 2.x tests/src/Kernel/XmlSitemapWriterTest.php \Drupal\Tests\xmlsitemap\Kernel\XmlSitemapWriterTest::testInvalidPage()

Test that an invalid page cannot be passed to the constructor.

@covers ::__construct

File

tests/src/Kernel/XmlSitemapWriterTest.php, line 32

Class

XmlSitemapWriterTest
Tests \Drupal\xmlsitemap\XmlSitemapWriter.

Namespace

Drupal\Tests\xmlsitemap\Kernel

Code

public function testInvalidPage() {
  $this
    ->expectExceptionObject(new \InvalidArgumentException("Invalid XML sitemap page invalid."));
  new XmlSitemapWriter($this->sitemap, 'invalid');
}