function AddFeedTest::urlToRSSLinkPattern in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/modules/system/src/Tests/Common/AddFeedTest.php \Drupal\system\Tests\Common\AddFeedTest::urlToRSSLinkPattern()
Creates a pattern representing the RSS feed in the page.
1 call to AddFeedTest::urlToRSSLinkPattern()
- AddFeedTest::testBasicFeedAddNoTitle in core/
modules/ system/ src/ Tests/ Common/ AddFeedTest.php - Tests attaching feeds with paths, URLs, and titles.
File
- core/
modules/ system/ src/ Tests/ Common/ AddFeedTest.php, line 80 - Contains \Drupal\system\Tests\Common\AddFeedTest.
Class
- AddFeedTest
- Make sure that attaching feeds works correctly with various constructs.
Namespace
Drupal\system\Tests\CommonCode
function urlToRSSLinkPattern($url, $title = '') {
// Escape any regular expression characters in the URL ('?' is the worst).
$url = preg_replace('/([+?.*])/', '[$0]', $url);
$generated_pattern = '%<link +href="' . $url . '" +rel="alternate" +title="' . $title . '" +type="application/rss.xml" */>%';
return $generated_pattern;
}