You are here

protected function XmlSitemapTestBase::regenerateSitemap in XML sitemap 8

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

Regenerate the sitemap by setting the regenerate flag and running cron.

7 calls to XmlSitemapTestBase::regenerateSitemap()
XmlSitemapEntityFunctionalTest::testEntityLinkBundleSettingsForm in tests/src/Functional/XmlSitemapEntityFunctionalTest.php
Test Entity Link Bundle Settings Form.
XmlSitemapFunctionalTest::testBaseURL in tests/src/Functional/XmlSitemapFunctionalTest.php
Test base URL functionality.
XmlSitemapFunctionalTest::testSitemapCaching in tests/src/Functional/XmlSitemapFunctionalTest.php
Test the sitemap file caching.
XmlSitemapMultilingualTest::testFrontpageLink in tests/src/Functional/XmlSitemapMultilingualTest.php
Tests the frontpage link for multiple languages.
XmlSitemapMultilingualTest::testLanguageSelection in tests/src/Functional/XmlSitemapMultilingualTest.php
Test Language Selection.

... See full list

File

tests/src/Functional/XmlSitemapTestBase.php, line 188

Class

XmlSitemapTestBase
Helper test class with some added functions for testing.

Namespace

Drupal\Tests\xmlsitemap\Functional

Code

protected function regenerateSitemap() {
  $this->state
    ->set('xmlsitemap_regenerate_needed', TRUE);
  $this->state
    ->set('xmlsitemap_generated_last', 0);
  $this
    ->cronRun();
  $this
    ->assertTrue($this->state
    ->get('xmlsitemap_generated_last') && !$this->state
    ->get('xmlsitemap_regenerate_needed'), t('XML sitemaps regenerated and flag cleared.'));
}