function FeedProcessorPluginTest::testPostProcess

Same name and namespace in other branches
  1. 8.9.x 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 61

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());
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.