You are here

protected function XMLSitemapTestHelper::addSitemapLink in XML sitemap 7.2

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

Add Sitemap Link.

6 calls to XMLSitemapTestHelper::addSitemapLink()
XMLSitemapI18nTest::testLanguageSelection in xmlsitemap_i18n/xmlsitemap_i18n.test
Language Selection.
XMLSitemapUnitTest::testDuplicatePaths in ./xmlsitemap.test
Test that duplicate paths are skipped during generation.
XMLSitemapUnitTest::testGetChunkCount in ./xmlsitemap.test
Tests for xmlsitemap_get_chunk_count().
XMLSitemapUnitTest::testLinkDelete in ./xmlsitemap.test
Tests for xmlsitemap_link_delete().
XMLSitemapUnitTest::testMinimumLifetime in ./xmlsitemap.test
Test that the sitemap will not be genereated before the lifetime expires.

... See full list

File

./xmlsitemap.test, line 246
Unit tests for the xmlsitemap.

Class

XMLSitemapTestHelper
Helper test class with some added functions for testing.

Code

protected function addSitemapLink(array $link = array()) {
  $last_id =& drupal_static(__FUNCTION__, 1);
  $link += array(
    'type' => 'testing',
    'id' => $last_id,
    'access' => 1,
    'status' => 1,
  );

  // Make the default path easier to read than a random string.
  $link += array(
    'loc' => $link['type'] . '-' . $link['id'],
  );
  $last_id = max($last_id, $link['id']) + 1;
  xmlsitemap_link_save($link);
  return $link;
}