You are here

public function QueueTest::testCronImport in Feeds 8.3

Tests if a feed gets imported via cron after adding it to the queue.

File

tests/src/Functional/QueueTest.php, line 15

Class

QueueTest
Tests behavior involving the queue.

Namespace

Drupal\Tests\feeds\Functional

Code

public function testCronImport() {
  $feed_type = $this
    ->createFeedType();

  // Create a feed and ensure it gets imported on cron.
  $feed = $this
    ->createFeed($feed_type
    ->id(), [
    'source' => $this
      ->resourcesUrl() . '/rss/googlenewstz.rss2',
  ]);
  $feed
    ->startCronImport();

  // Run cron to import.
  $this
    ->cronRun();

  // Assert that 6 nodes have been created.
  $this
    ->assertNodeCount(6);
}