You are here

public function XmlSitemapEnginesFunctionalTest::submitEngines in XML sitemap 8

Same name and namespace in other branches
  1. 2.x xmlsitemap_engines/tests/src/Functional/XmlSitemapEnginesFunctionalTest.php \Drupal\Tests\xmlsitemap_engines\Functional\XmlSitemapEnginesFunctionalTest::submitEngines()

Check if sitemaps are sent to searching engines.

2 calls to XmlSitemapEnginesFunctionalTest::submitEngines()
XmlSitemapEnginesFunctionalTest::testCustomURL in xmlsitemap_engines/tests/src/Functional/XmlSitemapEnginesFunctionalTest.php
Check if custom urls are functional.
XmlSitemapEnginesFunctionalTest::testPing in xmlsitemap_engines/tests/src/Functional/XmlSitemapEnginesFunctionalTest.php
Check if ping works.

File

xmlsitemap_engines/tests/src/Functional/XmlSitemapEnginesFunctionalTest.php, line 55

Class

XmlSitemapEnginesFunctionalTest
Test xmlsitemap_engines functionality.

Namespace

Drupal\Tests\xmlsitemap_engines\Functional

Code

public function submitEngines() {
  $request_time = $this->time
    ->getRequestTime();
  $this->state
    ->setMultiple([
    'xmlsitemap_engines_submit_last' => $request_time - 10000,
    'xmlsitemap_generated_last' => $request_time - 100,
  ]);
  \Drupal::configFactory()
    ->getEditable('xmlsitemap_engines.settings')
    ->set('minimum_lifetime', 0)
    ->save();
  xmlsitemap_engines_cron();
  $this
    ->assertTrue($this->state
    ->get('xmlsitemap_engines_submit_last') > $request_time - 100, 'Submitted the sitemaps to search engines.');
}