diff --git a/core/modules/aggregator/lib/Drupal/aggregator/Tests/FeedProcessorPluginTest.php b/core/modules/aggregator/lib/Drupal/aggregator/Tests/FeedProcessorPluginTest.php index 8b157d5..c578612 100644 --- a/core/modules/aggregator/lib/Drupal/aggregator/Tests/FeedProcessorPluginTest.php +++ b/core/modules/aggregator/lib/Drupal/aggregator/Tests/FeedProcessorPluginTest.php @@ -52,7 +52,7 @@ public function testRemove() { $feed = $this->createFeed(); $this->updateAndRemove($feed, NULL); // Make sure the feed title is changed. - $entities = entity_load_multiple_by_properties('aggregator_feed', array('title' => $feed->label())); + $entities = entity_load_multiple_by_properties('aggregator_feed', array('description' => $feed->description->value)); $this->assertTrue(empty($entities)); } @@ -60,10 +60,11 @@ public function testRemove() { * Test post-processing functionality. */ public function testPostProcess() { - $feed = $this->createFeed(); + $feed = $this->createFeed(NULL, array('refresh' => 1000)); $this->updateFeedItems($feed); // Reload the feed to get new values. $feed = entity_load('aggregator_feed', $feed->id(), TRUE); - $this->assertEqual($feed->refresh->value, AGGREGATOR_CLEAR_NEVER); + // Make sure its refresh rate doubled. + $this->assertEqual($feed->refresh->value, 2000); } } diff --git a/core/modules/aggregator/tests/lib/Drupal/aggregator_test/Plugin/aggregator/processor/TestProcessor.php b/core/modules/aggregator/tests/lib/Drupal/aggregator_test/Plugin/aggregator/processor/TestProcessor.php index 871c437..3da299a 100644 --- a/core/modules/aggregator/tests/lib/Drupal/aggregator_test/Plugin/aggregator/processor/TestProcessor.php +++ b/core/modules/aggregator/tests/lib/Drupal/aggregator_test/Plugin/aggregator/processor/TestProcessor.php @@ -65,8 +65,7 @@ public function settingsSubmit(array $form, array &$form_state) { */ public function process(Feed $feed) { foreach ($feed->items as &$item) { - // Do not truncate on 255 but 240, so we prepend our test string. - $item['title'] = truncate_utf8($item['title'], 240, TRUE, TRUE); + // Prepend our test string. $item['title'] = 'testProcessor' . $item['title']; } } @@ -75,17 +74,16 @@ public function process(Feed $feed) { * Implements \Drupal\aggregator\Plugin\ProcessorInterface::remove(). */ public function remove(Feed $feed) { - // Remove feed title. - $feed->title->value = ''; - $feed->save(); + // Append a random number, just to change the feed description. + $feed->description->value .= rand(0, 10); } /** * Implements \Drupal\aggregator\Plugin\ProcessorInterface::postProcess(). */ public function postProcess(Feed $feed) { - // Dont let this feed be updated again. - $feed->refresh->value = AGGREGATOR_CLEAR_NEVER; + // Double the refresh rate. + $feed->refresh->value *= 2; $feed->save(); } }