You are here

public function ExplodeTest::testExplodeWithNonStrictAndEmptySource 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::testExplodeWithNonStrictAndEmptySource()
  2. 9 core/modules/migrate/tests/src/Unit/process/ExplodeTest.php \Drupal\Tests\migrate\Unit\process\ExplodeTest::testExplodeWithNonStrictAndEmptySource()

Tests that explode works on non-strings but with strict set to FALSE.

@dataProvider providerExplodeWithNonStrictAndEmptySource

File

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

Class

ExplodeTest
Tests the Explode process plugin.

Namespace

Drupal\Tests\migrate\Unit\process

Code

public function testExplodeWithNonStrictAndEmptySource($value, $expected) {
  $plugin = new Explode([
    'delimiter' => '|',
    'strict' => FALSE,
  ], 'map', []);
  $processed = $plugin
    ->transform($value, $this->migrateExecutable, $this->row, 'destination_property');
  $this
    ->assertSame($expected, $processed);
}