public function XMLSitemapFunctionalTest::testSitemapCaching in XML sitemap 7.2
Same name and namespace in other branches
- 6.2 xmlsitemap.test \XMLSitemapFunctionalTest::testSitemapCaching()
Test the sitemap file caching.
File
- ./
xmlsitemap.test, line 906 - Unit tests for the xmlsitemap.
Class
- XMLSitemapFunctionalTest
- XML Sitemap Functional Test.
Code
public 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);
}