function FilterSettingsTest::testTransform

Same name and namespace in other branches
  1. 9 core/modules/filter/tests/src/Kernel/Plugin/migrate/process/FilterSettingsTest.php \Drupal\Tests\filter\Kernel\Plugin\migrate\process\FilterSettingsTest::testTransform()
  2. 8.9.x core/modules/filter/tests/src/Kernel/Plugin/migrate/process/FilterSettingsTest.php \Drupal\Tests\filter\Kernel\Plugin\migrate\process\FilterSettingsTest::testTransform()
  3. 10 core/modules/filter/tests/src/Kernel/Plugin/migrate/process/FilterSettingsTest.php \Drupal\Tests\filter\Kernel\Plugin\migrate\process\FilterSettingsTest::testTransform()

Tests transformation of filter settings.

@dataProvider dataProvider @covers ::transform

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 {
    $migration = $this->createMock(MigrationInterface::class);
    $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.