3 namespace Drupal\Tests\migrate\Unit\process;
5 use Drupal\migrate\MigrateSkipRowException;
6 use Drupal\migrate\Plugin\migrate\process\SkipRowIfNotSet;
9 * Tests the skip row if not set process plugin.
12 * @coversDefaultClass \Drupal\migrate\Plugin\migrate\process\SkipRowIfNotSet
14 class SkipRowIfNotSetTest extends MigrateProcessTestCase {
17 * Tests that a skip row exception without a message is raised.
21 public function testRowSkipWithoutMessage() {
23 'index' => 'some_key',
25 $process = new SkipRowIfNotSet($configuration, 'skip_row_if_not_set', []);
26 $this->setExpectedException(MigrateSkipRowException::class);
27 $process->transform('', $this->migrateExecutable, $this->row, 'destinationproperty');
31 * Tests that a skip row exception with a message is raised.
35 public function testRowSkipWithMessage() {
37 'index' => 'some_key',
38 'message' => "The 'some_key' key is not set",
40 $process = new SkipRowIfNotSet($configuration, 'skip_row_if_not_set', []);
41 $this->setExpectedException(MigrateSkipRowException::class, "The 'some_key' key is not set");
42 $process->transform('', $this->migrateExecutable, $this->row, 'destinationproperty');