public function MigrationTest::testSetInvalidation in Drupal 8
Same name and namespace in other branches
- 9 core/modules/migrate/tests/src/Kernel/MigrationTest.php \Drupal\Tests\migrate\Kernel\MigrationTest::testSetInvalidation()
Tests Migration::set().
@covers ::set
File
- core/
modules/ migrate/ tests/ src/ Kernel/ MigrationTest.php, line 28
Class
- MigrationTest
- Tests the migration plugin.
Namespace
Drupal\Tests\migrate\KernelCode
public function testSetInvalidation() {
$migration = \Drupal::service('plugin.manager.migration')
->createStubMigration([
'source' => [
'plugin' => 'empty',
],
'destination' => [
'plugin' => 'entity:entity_view_mode',
],
]);
$this
->assertEqual('empty', $migration
->getSourcePlugin()
->getPluginId());
$this
->assertEqual('entity:entity_view_mode', $migration
->getDestinationPlugin()
->getPluginId());
// Test the source plugin is invalidated.
$migration
->set('source', [
'plugin' => 'embedded_data',
'data_rows' => [],
'ids' => [],
]);
$this
->assertEqual('embedded_data', $migration
->getSourcePlugin()
->getPluginId());
// Test the destination plugin is invalidated.
$migration
->set('destination', [
'plugin' => 'null',
]);
$this
->assertEqual('null', $migration
->getDestinationPlugin()
->getPluginId());
}