You are here

public function FeedsSubscriberTest::testAfterParseWithNoTampers in Feeds Tamper 8.2

@covers ::afterParse @covers ::alterItem

File

tests/src/Unit/EventSubscriber/FeedsSubscriberTest.php, line 160

Class

FeedsSubscriberTest
@coversDefaultClass \Drupal\feeds_tamper\EventSubscriber\FeedsSubscriber @group feeds_tamper

Namespace

Drupal\Tests\feeds_tamper\Unit\EventSubscriber

Code

public function testAfterParseWithNoTampers() {
  $this->tamperMeta
    ->expects($this
    ->once())
    ->method('getTampersGroupedBySource')
    ->will($this
    ->returnValue([]));

  // Add an item to the parser result.
  $item = new DynamicItem();
  $item
    ->set('alpha', 'Bar');
  $this->event
    ->getParserResult()
    ->addItem($item);

  // Run event callback.
  $this->subscriber
    ->afterParse($this->event);
  $this
    ->assertEquals('Bar', $item
    ->get('alpha'));
}