function ExplodeTest::testExplodeWithNonStrictAndEmptySource

Same name in other branches
  1. 9 core/modules/migrate/tests/src/Unit/process/ExplodeTest.php \Drupal\Tests\migrate\Unit\process\ExplodeTest::testExplodeWithNonStrictAndEmptySource()
  2. 8.9.x core/modules/migrate/tests/src/Unit/process/ExplodeTest.php \Drupal\Tests\migrate\Unit\process\ExplodeTest::testExplodeWithNonStrictAndEmptySource()
  3. 10 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 71

Class

ExplodeTest
Tests the Explode process plugin.

Namespace

Drupal\Tests\migrate\Unit\process

Code

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

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