You are here

public function PathTest::testPrepareValue in Feeds 8.3

@covers ::prepareValue

@dataProvider valuesProvider

Parameters

string $expected: The expected path.

array $values: The values passed to the prepareValue() method.

File

tests/src/Unit/Feeds/Target/PathTest.php, line 55

Class

PathTest
@coversDefaultClass \Drupal\feeds\Feeds\Target\Path @group feeds

Namespace

Drupal\Tests\feeds\Unit\Feeds\Target

Code

public function testPrepareValue($expected, array $values) {
  $method = $this
    ->getMethod(Path::class, 'prepareTarget')
    ->getClosure();
  $configuration = [
    'feed_type' => $this
      ->createMock(FeedTypeInterface::class),
    'target_definition' => $method($this
      ->getMockFieldDefinition()),
  ];
  $target = new Path($configuration, 'path', []);
  $method = $this
    ->getProtectedClosure($target, 'prepareValue');
  $method(0, $values);
  $this
    ->assertSame($expected, $values['alias']);
}