Mercurial > hg > isophonics-drupal-site
comparison core/modules/migrate/tests/src/Kernel/MigrateSkipRowTest.php @ 14:1fec387a4317
Update Drupal core to 8.5.2 via Composer
author | Chris Cannam |
---|---|
date | Mon, 23 Apr 2018 09:46:53 +0100 |
parents | 4c8ae668cc8c |
children |
comparison
equal
deleted
inserted
replaced
13:5fb285c0d0e3 | 14:1fec387a4317 |
---|---|
1 <?php | 1 <?php |
2 | 2 |
3 namespace Drupal\Tests\migrate\Kernel; | 3 namespace Drupal\Tests\migrate\Kernel; |
4 | 4 |
5 use Drupal\KernelTests\KernelTestBase; | 5 use Drupal\KernelTests\KernelTestBase; |
6 use Drupal\migrate\MigrateMessage; | |
7 use Drupal\migrate\Plugin\MigrationInterface; | 6 use Drupal\migrate\Plugin\MigrationInterface; |
8 use Drupal\migrate\MigrateExecutable; | 7 use Drupal\migrate\MigrateExecutable; |
9 use Drupal\migrate\Plugin\MigrateIdMapInterface; | 8 use Drupal\migrate\Plugin\MigrateIdMapInterface; |
10 | 9 |
11 /** | 10 /** |
48 'load' => ['plugin' => 'null'], | 47 'load' => ['plugin' => 'null'], |
49 ]; | 48 ]; |
50 | 49 |
51 $migration = \Drupal::service('plugin.manager.migration')->createStubMigration($definition); | 50 $migration = \Drupal::service('plugin.manager.migration')->createStubMigration($definition); |
52 | 51 |
53 $executable = new MigrateExecutable($migration, new MigrateMessage()); | 52 $executable = new MigrateExecutable($migration); |
54 $result = $executable->import(); | 53 $result = $executable->import(); |
55 $this->assertEqual($result, MigrationInterface::RESULT_COMPLETED); | 54 $this->assertEqual($result, MigrationInterface::RESULT_COMPLETED); |
56 | 55 |
57 /** @var \Drupal\migrate\Plugin\MigrateIdMapInterface $id_map_plugin */ | 56 /** @var \Drupal\migrate\Plugin\MigrateIdMapInterface $id_map_plugin */ |
58 $id_map_plugin = $migration->getIdMap(); | 57 $id_map_plugin = $migration->getIdMap(); |
83 ['id' => '1', 'data' => 'skip_and_record (use plugin)'], | 82 ['id' => '1', 'data' => 'skip_and_record (use plugin)'], |
84 ['id' => '2', 'data' => 'skip_and_dont_record (use plugin)'], | 83 ['id' => '2', 'data' => 'skip_and_dont_record (use plugin)'], |
85 ]; | 84 ]; |
86 $migration = \Drupal::service('plugin.manager.migration')->createStubMigration($definition); | 85 $migration = \Drupal::service('plugin.manager.migration')->createStubMigration($definition); |
87 | 86 |
88 $executable = new MigrateExecutable($migration, new MigrateMessage()); | 87 $executable = new MigrateExecutable($migration); |
89 $result = $executable->import(); | 88 $result = $executable->import(); |
90 $this->assertEquals($result, MigrationInterface::RESULT_COMPLETED); | 89 $this->assertEquals($result, MigrationInterface::RESULT_COMPLETED); |
91 | 90 |
92 $id_map_plugin = $migration->getIdMap(); | 91 $id_map_plugin = $migration->getIdMap(); |
93 | 92 |