You are here

public function ExplodeTest::testExplodeWithEmptyDelimiter in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/migrate/tests/src/Unit/process/ExplodeTest.php \Drupal\Tests\migrate\Unit\process\ExplodeTest::testExplodeWithEmptyDelimiter()
  2. 9 core/modules/migrate/tests/src/Unit/process/ExplodeTest.php \Drupal\Tests\migrate\Unit\process\ExplodeTest::testExplodeWithEmptyDelimiter()

Tests explode fails with empty delimiter.

File

core/modules/migrate/tests/src/Unit/process/ExplodeTest.php, line 116

Class

ExplodeTest
Tests the Explode process plugin.

Namespace

Drupal\Tests\migrate\Unit\process

Code

public function testExplodeWithEmptyDelimiter() {
  $this
    ->expectException(MigrateException::class);
  $this
    ->expectExceptionMessage('delimiter is empty');
  $plugin = new Explode([
    'delimiter' => '',
  ], 'map', []);
  $plugin
    ->transform('foo,bar', $this->migrateExecutable, $this->row, 'destination_property');
}