diff options
Diffstat (limited to 'modules/aggregator')
-rw-r--r-- | modules/aggregator/aggregator.test | 15 | ||||
-rw-r--r-- | modules/aggregator/tests/aggregator_test_title_entities.xml | 14 |
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" 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" Amp&</title> + <link>http://example.com/example-turns-one</link> + <description>Some text.</description> + </item> + </channel> +</rss> |