function FilterSettingsTest::testTransform
Same name in other branches
- 9 core/modules/filter/tests/src/Kernel/Plugin/migrate/process/FilterSettingsTest.php \Drupal\Tests\filter\Kernel\Plugin\migrate\process\FilterSettingsTest::testTransform()
- 10 core/modules/filter/tests/src/Kernel/Plugin/migrate/process/FilterSettingsTest.php \Drupal\Tests\filter\Kernel\Plugin\migrate\process\FilterSettingsTest::testTransform()
- 11.x 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 25
Class
- FilterSettingsTest
- Unit tests of the filter_settings plugin.
Namespace
Drupal\Tests\filter\Kernel\Plugin\migrate\processCode
public function testTransform($value, $destination_id, $expected_value) {
$migration = $this->createMock(MigrationInterface::class);
$plugin = new FilterSettings([], 'filter_settings', [], $migration);
$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.