You are here

protected function XMLSitemapTestHelper::drupalGetSitemap in XML sitemap 7.2

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

Retrieves an XML sitemap.

Parameters

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

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

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

Return value

string 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
Language Selection.
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 88
Unit tests for the xmlsitemap.

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);
}