You are here

public function XmlSitemapEnginesFunctionalTest::testPrepareURL in XML sitemap 8

Same name and namespace in other branches
  1. 2.x xmlsitemap_engines/tests/src/Functional/XmlSitemapEnginesFunctionalTest.php \Drupal\Tests\xmlsitemap_engines\Functional\XmlSitemapEnginesFunctionalTest::testPrepareURL()

Check if an url is correctly prepared.

@codingStandardsIgnoreStart

File

xmlsitemap_engines/tests/src/Functional/XmlSitemapEnginesFunctionalTest.php, line 71

Class

XmlSitemapEnginesFunctionalTest
Test xmlsitemap_engines functionality.

Namespace

Drupal\Tests\xmlsitemap_engines\Functional

Code

public function testPrepareURL() {

  // @codingStandardsIgnoreEnd
  $sitemap = 'http://example.com/sitemap.xml';
  $input = 'http://example.com/ping?sitemap=[sitemap]&foo=bar';
  $output = 'http://example.com/ping?sitemap=http://example.com/sitemap.xml&foo=bar';
  $this
    ->assertEquals($output, xmlsitemap_engines_prepare_url($input, $sitemap));
}