Commit ff7a4237 authored by Dave Reid's avatar Dave Reid
Browse files

by Dave Reid: Updating base tests.

parent cb6caf1d
......@@ -166,12 +166,10 @@ class XMLSitemapTestHelper extends DrupalWebTestCase {
protected function assertNoXMLSitemapProblems() {
$this->drupalGet('admin/config/search/xmlsitemap');
$this->assertNoText(t('One or more problems were detected with your sitemap configuration. Please check the status report for more information.'));
$this->assertNoText(t('One or more problems were detected with your XML sitemap configuration. Please check the status report for more information.'));
}
private function getWatchdogMessage(array $conditions) {
static $watchdog_schema;
$query = db_select('watchdog');
$query->fields('watchdog');
foreach ($conditions as $field => $value) {
......@@ -180,7 +178,6 @@ class XMLSitemapTestHelper extends DrupalWebTestCase {
}
$query->conditions($field, $value);
}
return $query->execute()->fetchAll();
}
......@@ -621,27 +618,28 @@ class XMLSitemapFunctionalTest extends XMLSitemapTestHelper {
* Test that the sitemap will not be genereated before the lifetime expires.
*/
function testMinimumLifetime() {
$this->regenerateSitemap();
$edit = array('xmlsitemap_minimum_lifetime' => 300);
$this->drupalPost('admin/config/search/xmlsitemap', $edit, t('Save configuration'));
$this->assertText(t('The configuration options have been saved.'));
xmlsitemap_save_link(array('type' => 'testing', 'id' => 1, 'loc' => 'lifetime-test'));
$this->addSitemapLink(array('loc' => 'lifetime-test'));
drupal_cron_run();
$this->drupalGet('sitemap.xml');
$this->drupalGetSitemap();
$this->assertNoRaw('lifetime-test');
variable_set('xmlsitemap_generated_last', REQUEST_TIME - 300);
drupal_cron_run();
$this->drupalGet('sitemap.xml');
$this->drupalGetSitemap();
$this->assertRaw('lifetime-test');
xmlsitemap_delete_link(array('type' => 'testing', 'id' => 1));
drupal_cron_run();
$this->drupalGet('sitemap.xml');
$this->drupalGetSitemap();
$this->assertRaw('lifetime-test');
$this->regenerateSitemap();
$this->drupalGet('sitemap.xml');
$this->drupalGetSitemap(LANGUAGE_NONE, TRUE);
$this->assertNoRaw('lifetime-test');
}
......
......@@ -6,3 +6,4 @@ core = 7.x
dependencies[] = xmlsitemap
files[] = xmlsitemap_node.module
files[] = xmlsitemap_node.install
files[] = xmlsitemap_node.test
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