You are here

xmlsitemap_engines_test.module in XML sitemap 8

Main file for the XML sitemap engines test.

File

xmlsitemap_engines/tests/modules/xmlsitemap_engines_test/xmlsitemap_engines_test.module
View source
<?php

/**
 * @file
 * Main file for the XML sitemap engines test.
 */
use Drupal\Core\Url;

/**
 * Implements hook_xmlsitemap_engine_info().
 */
function xmlsitemap_engines_test_xmlsitemap_engine_info() {
  $engines['simpletest'] = [
    'name' => t('SimpleTest'),
    'url' => 'http://example.com/',
  ];
  return $engines;
}

/**
 * Implements hook_xmlsitemap_engine_info_alter().
 */
function xmlsitemap_engines_test_xmlsitemap_engine_info_alter(&$engines) {
  $engines['simpletest']['url'] = Url::fromUri('internal:/ping', [
    'absolute' => TRUE,
    'query' => [
      'sitemap' => '',
    ],
  ])
    ->toString() . '[sitemap]';
}