function FilterSettingsTest::testTransform

Tests transformation of filter settings.

@legacy-covers ::transform

Attributes

#[DataProvider('dataProvider')]

File

core/modules/filter/tests/src/Kernel/Plugin/migrate/process/FilterSettingsTest.php, line 27

Class

FilterSettingsTest
Unit tests of the filter_settings plugin.

Namespace

Drupal\Tests\filter\Kernel\Plugin\migrate\process

Code

public function testTransform($value, $destination_id, $expected_value) : void {
  $plugin = new FilterSettings([], 'filter_settings', []);
  $executable = $this->createMock(MigrateExecutableInterface::class);
  $row = $this->getMockBuilder(Row::class)
    ->disableOriginalConstructor()
    ->getMock();
  $row->expects($this->atLeastOnce())
    ->method('getDestinationProperty')
    ->willReturn($destination_id);
  $output_value = $plugin->transform($value, $executable, $row, 'foo');
  $this->assertSame($expected_value, $output_value);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.