You are here

public function EntityProcessorBaseTest::testCleanWithKeepNonExistent in Feeds 8.3

@covers ::clean

File

tests/src/Kernel/Feeds/Processor/EntityProcessorBaseTest.php, line 134

Class

EntityProcessorBaseTest
@coversDefaultClass \Drupal\feeds\Feeds\Processor\EntityProcessorBase @group feeds

Namespace

Drupal\Tests\feeds\Kernel\Feeds\Processor

Code

public function testCleanWithKeepNonExistent() {

  // Add feeds_item field to article content type.
  $this
    ->callProtectedMethod($this->processor, 'prepareFeedsItemField');

  // Create an entity with a feeds item field.
  $node = $this
    ->createNodeWithFeedsItem($this->feed);

  // Get hash of node.
  $hash = $node->feeds_item->hash;

  // Clean.
  $this->processor
    ->clean($this->feed, $node, new CleanState($this->feed
    ->id()));

  // Assert that the hash did not change.
  $this
    ->assertEquals($hash, $node->feeds_item->hash);
}