function ExplodeTest::testTransformLimit

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

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