Tests creation of feeds with a language.
public function testFeedLanguage() {
$feeds = array();
// Create feeds.
$feeds[1] = $this
->createFeed(NULL, array(
'langcode' => $this->langcodes[1]->langcode,
));
$feeds[2] = $this
->createFeed(NULL, array(
'langcode' => $this->langcodes[2]->langcode,
));
// Make sure that the language has been assigned.
$this
->assertEqual($feeds[1]
->language()->langcode, $this->langcodes[1]->langcode);
$this
->assertEqual($feeds[2]
->language()->langcode, $this->langcodes[2]->langcode);
// Create example nodes to create feed items from and then update the feeds.
$this
->createSampleNodes();
$this
->cronRun();
// Loop over the created feed items and verify that their language matches
// the one from the feed.
foreach ($feeds as $feed) {
$items = entity_load_multiple_by_properties('aggregator_item', array(
'fid' => $feed
->id(),
));
$this
->assertTrue(count($items) > 0, 'Feed items were created.');
foreach ($items as $item) {
$this
->assertEqual($item
->language()->langcode, $feed
->language()->langcode);
}
}
}