You are here

public function ExplodeTest::testExplodeWithStrictAndEmptyString in Drupal 8

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

Tests that explode with an empty string and strict check returns a non-empty array.

File

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

Class

ExplodeTest
Tests the Explode process plugin.

Namespace

Drupal\Tests\migrate\Unit\process

Code

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