You are here

public function FeedRefreshTest::testParseStage in Feeds 8.3

Tests the parse stage of an import.

File

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

Class

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

Namespace

Drupal\Tests\feeds\Unit\Plugin\QueueWorker

Code

public function testParseStage() {
  $this->dispatcher
    ->addListener(FeedsEvents::PARSE, function ($parse_event) {
    $parser_result = new ParserResult();
    $parser_result
      ->addItem(new DynamicItem());
    $parse_event
      ->setParserResult($parser_result);
  });
  $fetcher_result = new FetcherResult('');
  $this->plugin
    ->processItem([
    $this->feed,
    FeedsExecutableInterface::PARSE,
    [
      'fetcher_result' => $fetcher_result,
    ],
  ]);
}