Commit 5182bccc authored by WalkingDexter's avatar WalkingDexter Committed by atymchuk

Several functional tests.

parent 8eb36f23
<?php
/**
* @file
* Contains functional tests for Simple XML Sitemap (Views).
*/
namespace Drupal\Tests\simple_sitemap_views\Functional;
/**
* Tests Simple XML Sitemap (Views) functional integration.
*
* @group simple_sitemap_views
*/
class SimpleSitemapViewsTest extends SimpleSitemapViewsTestBase {
/**
* Tests Views URL generator availability.
*/
public function testViewsUrlGeneratorAvailability() {
$sitemap_types = $this->generator->getSitemapManager()->getSitemapTypes();
$this->assertContains('views', $sitemap_types['default_hreflang']['urlGenerators']);
}
/**
* Tests status of sitemap support for views.
*/
public function testSitemapSupportForViews() {
// Views support must be enabled after module installation.
$this->assertTrue($this->sitemapViews->isEnabled());
$this->sitemapViews->disable();
$this->assertFalse($this->sitemapViews->isEnabled());
$this->sitemapViews->enable();
$this->assertTrue($this->sitemapViews->isEnabled());
}
}
<?php
/**
* @file
* Contains a base class for Simple XML Sitemap (Views) functional testing.
*/
namespace Drupal\Tests\simple_sitemap_views\Functional;
use Drupal\Tests\simple_sitemap\Functional\SimplesitemapTestBase;
/**
* Defines a base class for Simple XML Sitemap (Views) functional testing.
*/
abstract class SimpleSitemapViewsTestBase extends SimplesitemapTestBase {
/**
* {@inheritdoc}
*/
public static $modules = ['simple_sitemap_views'];
/**
* Views sitemap data.
*
* @var \Drupal\simple_sitemap_views\SimpleSitemapViews
*/
protected $sitemapViews;
/**
* {@inheritdoc}
*/
protected function setUp() {
parent::setUp();
$this->sitemapViews = $this->container->get('simple_sitemap.views');
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment