You are here

public function FeedFetcherPluginTest::testfetch in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/aggregator/src/Tests/FeedFetcherPluginTest.php \Drupal\aggregator\Tests\FeedFetcherPluginTest::testfetch()

Test fetching functionality.

File

core/modules/aggregator/src/Tests/FeedFetcherPluginTest.php, line 33
Contains \Drupal\aggregator\Tests\FeedFetcherPluginTest.

Class

FeedFetcherPluginTest
Tests the fetcher plugins functionality and discoverability.

Namespace

Drupal\aggregator\Tests

Code

public function testfetch() {

  // Create feed with local url.
  $feed = $this
    ->createFeed();
  $this
    ->updateFeedItems($feed);
  $this
    ->assertFalse(empty($feed->items));

  // Delete items and restore checked property to 0.
  $this
    ->deleteFeedItems($feed);

  // Change its name and try again.
  $feed
    ->setTitle('Do not fetch');
  $feed
    ->save();
  $this
    ->updateFeedItems($feed);

  // Fetch should fail due to feed name.
  $this
    ->assertTrue(empty($feed->items));
}