You are here

public function FeedRefreshTest::testExceptionOnParseEvent in Feeds 8.3

Tests dispatching a parse event when running a queue task.

When running a queue task at the parse stage, a parse event should get dispatched.

File

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

Class

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

Namespace

Drupal\Tests\feeds\Unit\Plugin\QueueWorker

Code

public function testExceptionOnParseEvent() {
  $this->dispatcher
    ->addListener(FeedsEvents::PARSE, function ($parse_event) {
    throw new RuntimeException();
  });
  $this
    ->expectException(RuntimeException::class);
  $this->plugin
    ->processItem([
    $this->feed,
    FeedsExecutableInterface::PARSE,
    [
      'fetcher_result' => new FetcherResult(''),
    ],
  ]);
}