You are here

function XMLSitemapFunctionalTest::testStatusReport in XML sitemap 6.2

Same name and namespace in other branches
  1. 7.2 xmlsitemap.test \XMLSitemapFunctionalTest::testStatusReport()

Test that configuration problems are reported properly in the status report.

File

./xmlsitemap.test, line 761
Unit tests for the xmlsitemap module.

Class

XMLSitemapFunctionalTest

Code

function testStatusReport() {

  // Test the rebuild flag.
  // @todo Re-enable these tests once we get a xmlsitemap_test.module.

  //variable_set('xmlsitemap_generated_last', REQUEST_TIME);

  //variable_set('xmlsitemap_rebuild_needed', TRUE);

  //$this->assertXMLSitemapProblems(t('The XML sitemap data is out of sync and needs to be completely rebuilt.'));

  //$this->clickLink(t('completely rebuilt'));

  //$this->assertResponse(200);

  //variable_set('xmlsitemap_rebuild_needed', FALSE);

  //$this->assertNoXMLSitemapProblems();

  // Test the regenerate flag (and cron hasn't run in a while).
  variable_set('xmlsitemap_regenerate_needed', TRUE);
  variable_set('xmlsitemap_generated_last', REQUEST_TIME - variable_get('cron_threshold_warning', 172800) - 100);
  $this
    ->assertXMLSitemapProblems(t('The XML cached files are out of date and need to be regenerated. You can run cron manually to regenerate the sitemap files.'));
  $this
    ->clickLink(t('run cron manually'));
  $this
    ->assertResponse(200);
  $this
    ->assertNoXMLSitemapProblems();

  // Test chunk count > 1000.
  // Test directory not writable.
}