function SkipOnEmptyTest::testRowSkipWithMessage

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

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

@covers ::row

File

core/modules/migrate/tests/src/Unit/process/SkipOnEmptyTest.php, line 80

Class

SkipOnEmptyTest
Tests the skip on empty process plugin.

Namespace

Drupal\Tests\migrate\Unit\process

Code

public function testRowSkipWithMessage() : void {
    $configuration = [
        'method' => 'row',
        'message' => 'The value is empty',
    ];
    $process = new SkipOnEmpty($configuration, 'skip_on_empty', []);
    $this->expectException(MigrateSkipRowException::class);
    $this->expectExceptionMessage('The value is empty');
    $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.