You are here

public function TestRevisionHandler::testHandle in Feeds Paragraphs 8

@covers ::handle

File

tests/src/Unit/TestRevisionHandler.php, line 71

Class

TestRevisionHandler
@group Feeds Paragraphs @coversDefaultClass \Drupal\feeds_para_mapper\RevisionHandler

Namespace

Drupal\Tests\feeds_para_mapper\Unit

Code

public function testHandle() {
  $field = end($this->fields)
    ->reveal();
  $info = $this
    ->getTargetInfo();
  $field
    ->set('target_info', $info);
  $fpm_targets = array();
  $fpm_targets[$field
    ->getName()] = $field;
  $node = $this->node
    ->reveal();
  $node->fpm_targets = $fpm_targets;
  $revHandler = $this
    ->getMockBuilder(RevisionHandler::class)
    ->disableOriginalConstructor()
    ->setMethods([
    'checkUpdates',
    'cleanUp',
  ])
    ->getMock();
  $revHandler
    ->expects($this
    ->atLeastOnce())
    ->method('checkUpdates');
  $revHandler
    ->expects($this
    ->atLeastOnce())
    ->method('cleanUp');
  $revHandler
    ->handle($node);
}