You are here

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

Tests explode transform process works with a limit.

File

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

Class

ExplodeTest
Tests the Explode process plugin.

Namespace

Drupal\Tests\migrate\Unit\process

Code

public function testTransformLimit() {
  $plugin = new Explode([
    'delimiter' => '_',
    'limit' => 2,
  ], 'map', []);
  $value = $plugin
    ->transform('foo_bar_tik', $this->migrateExecutable, $this->row, 'destination_property');
  $this
    ->assertSame([
    'foo',
    'bar_tik',
  ], $value);
}