function XMLSitemapFunctionalTest::testSitemapCaching in XML sitemap 6.2
Same name and namespace in other branches
- 7.2 xmlsitemap.test \XMLSitemapFunctionalTest::testSitemapCaching()
Test the sitemap file caching.
File
- ./
xmlsitemap.test, line 720 - Unit tests for the xmlsitemap module.
Class
Code
function testSitemapCaching() {
$this
->regenerateSitemap();
$this
->drupalGetSitemap();
$this
->assertResponse(200);
$etag = $this
->drupalGetHeader('etag');
$last_modified = $this
->drupalGetHeader('last-modified');
$this
->assertTrue($etag, t('Etag header found.'));
$this
->assertTrue($last_modified, t('Last-modified header found.'));
$this
->drupalGetSitemap(array(), array(), array(
'If-Modified-Since: ' . $last_modified,
'If-None-Match: ' . $etag,
));
$this
->assertResponse(304);
}