You are here

public function FeedRefreshTest::testExceptionOnFetchEvent in Feeds 8.3

Tests that a fetch event is dispatched when initiating an import.

File

tests/src/Unit/Plugin/QueueWorker/FeedRefreshTest.php, line 129

Class

FeedRefreshTest
@coversDefaultClass \Drupal\feeds\Plugin\QueueWorker\FeedRefresh @group feeds

Namespace

Drupal\Tests\feeds\Unit\Plugin\QueueWorker

Code

public function testExceptionOnFetchEvent() {
  $this->dispatcher
    ->addListener(FeedsEvents::FETCH, function ($parse_event) {
    throw new RuntimeException();
  });
  $this
    ->expectException(RuntimeException::class);
  $this->plugin
    ->processItem([
    $this->feed,
    FeedsExecutableInterface::FETCH,
    [],
  ]);
}