summaryrefslogtreecommitdiff
path: root/modules/aggregator
diff options
context:
space:
mode:
authorDavid Rothstein <drothstein@gmail.com>2014-05-05 11:59:23 -0400
committerDavid Rothstein <drothstein@gmail.com>2014-05-05 11:59:23 -0400
commit478d1a04962de0ae6ef93fc2bde0c751840d36e6 (patch)
treef0f1ec5c90a4f583f61f3c807d4811f5265861fc /modules/aggregator
parentc32199c82b0262ec2a1879e2f211263c0911a11a (diff)
downloadbrdo-478d1a04962de0ae6ef93fc2bde0c751840d36e6.tar.gz
brdo-478d1a04962de0ae6ef93fc2bde0c751840d36e6.tar.bz2
Issue #61456 by Albert Volkman, jeffschuler, David_Rothstein, jdefay, edmund.kwok, pillarsdotnet, xjm, alex_b, csevb10, Steve Dondley: Write tests for issues with aggregator titles displaying quotes and other characters with HTML entity equivalents badly.
Diffstat (limited to 'modules/aggregator')
-rw-r--r--modules/aggregator/aggregator.test15
-rw-r--r--modules/aggregator/tests/aggregator_test_title_entities.xml14
2 files changed, 29 insertions, 0 deletions
diff --git a/modules/aggregator/aggregator.test b/modules/aggregator/aggregator.test
index 18d5b3351..d84ee7852 100644
--- a/modules/aggregator/aggregator.test
+++ b/modules/aggregator/aggregator.test
@@ -288,6 +288,10 @@ EOF;
return $GLOBALS['base_url'] . '/' . drupal_get_path('module', 'aggregator') . '/tests/aggregator_test_atom.xml';
}
+ function getHtmlEntitiesSample() {
+ return $GLOBALS['base_url'] . '/' . drupal_get_path('module', 'aggregator') . '/tests/aggregator_test_title_entities.xml';
+ }
+
/**
* Creates sample article nodes.
*
@@ -1016,4 +1020,15 @@ class FeedParserTestCase extends AggregatorTestCase {
$this->assertText('Some text.');
$this->assertEqual('urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a', db_query('SELECT guid FROM {aggregator_item} WHERE link = :link', array(':link' => 'http://example.org/2003/12/13/atom03'))->fetchField(), 'Atom entry id element is parsed correctly.');
}
+
+ /**
+ * Tests a feed that uses HTML entities in item titles.
+ */
+ function testHtmlEntitiesSample() {
+ $feed = $this->createFeed($this->getHtmlEntitiesSample());
+ aggregator_refresh($feed);
+ $this->drupalGet('aggregator/sources/' . $feed->fid);
+ $this->assertResponse(200, format_string('Feed %name exists.', array('%name' => $feed->title)));
+ $this->assertRaw("Quote&quot; Amp&amp;");
+ }
}
diff --git a/modules/aggregator/tests/aggregator_test_title_entities.xml b/modules/aggregator/tests/aggregator_test_title_entities.xml
new file mode 100644
index 000000000..e526e4418
--- /dev/null
+++ b/modules/aggregator/tests/aggregator_test_title_entities.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<rss version="0.91">
+ <channel>
+ <title>Example with Entities</title>
+ <link>http://example.com</link>
+ <description>Example RSS Feed With HTML Entities in Title</description>
+ <language>en-us</language>
+ <item>
+ <title>Quote&quot; Amp&amp;</title>
+ <link>http://example.com/example-turns-one</link>
+ <description>Some text.</description>
+ </item>
+ </channel>
+</rss>