You are here

public function TestWrapperTarget::testPrepareTarget in Feeds Paragraphs 8

@covers ::prepareTarget

File

tests/src/Unit/TestWrapperTarget.php, line 63

Class

TestWrapperTarget
@group Feeds Paragraphs @coversDefaultClass \Drupal\feeds_para_mapper\Feeds\Target\WrapperTarget

Namespace

Drupal\Tests\feeds_para_mapper\Unit

Code

public function testPrepareTarget() {
  $method = $this
    ->getMethod(Text::class, 'prepareTarget')
    ->getClosure();
  $field = $this->fieldHelper
    ->getBundleFields('bundle_two')[0]
    ->reveal();
  $info = $this
    ->getTargetInfo();
  $field
    ->set('target_info', $info);
  $textDef = $method($field);
  $textPCount = count($textDef
    ->getProperties());
  $method = $this
    ->getMethod(WrapperTarget::class, 'prepareTarget')
    ->getClosure();
  $wrapperDef = $method($field);
  $wrapperPCount = count($wrapperDef
    ->getProperties());
  $this
    ->assertSame($textPCount, $wrapperPCount, 'The wrapper has the target properties');
}