You are here

protected function XMLSitemapTestHelper::drupalGetSitemap in XML sitemap 6.2

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

Retrieves an XML sitemap.

Parameters

$context: An optional array of the XML sitemap's context.

$options: Options to be forwarded to url(). These values will be merged with, but always override $sitemap->uri['options'].

$headers: An array containing additional HTTP request headers, each formatted as "name: value".

Return value

The retrieved HTML string, also available as $this->drupalGetContent()

5 calls to XMLSitemapTestHelper::drupalGetSitemap()
XMLSitemapFunctionalTest::testBaseURL in ./xmlsitemap.test
Test base URL functionality.
XMLSitemapFunctionalTest::testSitemapCaching in ./xmlsitemap.test
Test the sitemap file caching.
XMLSitemapI18nTest::testLanguageSelection in xmlsitemap_i18n/xmlsitemap_i18n.test
XMLSitemapUnitTest::testDuplicatePaths in ./xmlsitemap.test
Test that duplicate paths are skipped during generation.
XMLSitemapUnitTest::testMinimumLifetime in ./xmlsitemap.test
Test that the sitemap will not be genereated before the lifetime expires.

File

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

Class

XMLSitemapTestHelper
Helper test class with some added functions for testing.

Code

protected function drupalGetSitemap(array $context = array(), array $options = array(), array $headers = array()) {
  $sitemap = xmlsitemap_sitemap_load_by_context($context);
  if (!$sitemap) {
    return $this
      ->fail('Could not load sitemap by context.');
  }
  return $this
    ->drupalGet($sitemap->uri['path'], $options + $sitemap->uri['options'], $headers);
}