You are here

public function FeedProcessorPluginTest::testPostProcess in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/aggregator/tests/src/Functional/FeedProcessorPluginTest.php \Drupal\Tests\aggregator\Functional\FeedProcessorPluginTest::testPostProcess()

Tests post-processing functionality.

File

core/modules/aggregator/tests/src/Functional/FeedProcessorPluginTest.php, line 60

Class

FeedProcessorPluginTest
Tests the processor plugins functionality and discoverability.

Namespace

Drupal\Tests\aggregator\Functional

Code

public function testPostProcess() {
  $feed = $this
    ->createFeed(NULL, [
    'refresh' => 1800,
  ]);
  $this
    ->updateFeedItems($feed);
  $feed_id = $feed
    ->id();

  // Reset entity cache manually.
  \Drupal::entityTypeManager()
    ->getStorage('aggregator_feed')
    ->resetCache([
    $feed_id,
  ]);

  // Reload the feed to get new values.
  $feed = Feed::load($feed_id);

  // Make sure its refresh rate doubled.
  $this
    ->assertEquals(3600, $feed
    ->getRefreshRate());
}