function SkipRowIfNotSetTest::testRowSkipWithMessage

Same name in other branches
  1. 8.9.x core/modules/migrate/tests/src/Unit/process/SkipRowIfNotSetTest.php \Drupal\Tests\migrate\Unit\process\SkipRowIfNotSetTest::testRowSkipWithMessage()
  2. 10 core/modules/migrate/tests/src/Unit/process/SkipRowIfNotSetTest.php \Drupal\Tests\migrate\Unit\process\SkipRowIfNotSetTest::testRowSkipWithMessage()
  3. 11.x core/modules/migrate/tests/src/Unit/process/SkipRowIfNotSetTest.php \Drupal\Tests\migrate\Unit\process\SkipRowIfNotSetTest::testRowSkipWithMessage()

Tests that a skip row exception with a message is raised.

@covers ::transform

File

core/modules/migrate/tests/src/Unit/process/SkipRowIfNotSetTest.php, line 35

Class

SkipRowIfNotSetTest
Tests the skip row if not set process plugin.

Namespace

Drupal\Tests\migrate\Unit\process

Code

public function testRowSkipWithMessage() {
    $configuration = [
        'index' => 'some_key',
        'message' => "The 'some_key' key is not set",
    ];
    $process = new SkipRowIfNotSet($configuration, 'skip_row_if_not_set', []);
    $this->expectException(MigrateSkipRowException::class);
    $this->expectExceptionMessage("The 'some_key' key is not set");
    $process->transform('', $this->migrateExecutable, $this->row, 'destination_property');
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.