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 0000000..e526e44 --- /dev/null +++ b/modules/aggregator/tests/aggregator_test_title_entities.xml @@ -0,0 +1,14 @@ + + + + Example with Entities + http://example.com + Example RSS Feed With HTML Entities in Title + en-us + + Quote" Amp& + http://example.com/example-turns-one + Some text. + + + diff --git a/modules/aggregator/aggregator.test b/modules/aggregator/aggregator.test index 0d1e31b..5cdb8b6 100644 --- a/modules/aggregator/aggregator.test +++ b/modules/aggregator/aggregator.test @@ -266,6 +266,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. * @@ -883,5 +887,16 @@ 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, t('Feed %name exists.', array('%name' => $feed->title))); + $this->assertRaw("Quote" Amp&"); + } }