You are here

public function FeedRefreshTest::testExceptionOnProcessEvent in Feeds 8.3

Tests dispatching a process event when running a queue task.

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

File

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

Class

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

Namespace

Drupal\Tests\feeds\Unit\Plugin\QueueWorker

Code

public function testExceptionOnProcessEvent() {
  $this->dispatcher
    ->addListener(FeedsEvents::PROCESS, function ($parse_event) {
    throw new RuntimeException();
  });
  $this
    ->expectException(RuntimeException::class);
  $this->plugin
    ->processItem([
    $this->feed,
    FeedsExecutableInterface::PROCESS,
    [
      'item' => new DynamicItem(),
    ],
  ]);
}