You are here

public function FlattenTest::testFlatten in Zircon Profile 8

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

Test that various array flatten operations work properly.

File

core/modules/migrate/tests/src/Unit/process/FlattenTest.php, line 21
Contains \Drupal\Tests\migrate\Unit\process\FlattenTest.

Class

FlattenTest
Tests the flatten plugin.

Namespace

Drupal\Tests\migrate\Unit\process

Code

public function testFlatten() {
  $plugin = new Flatten(array(), 'flatten', array());
  $flattened = $plugin
    ->transform(array(
    1,
    2,
    array(
      3,
      4,
      array(
        5,
      ),
    ),
    array(),
    array(
      7,
      8,
    ),
  ), $this->migrateExecutable, $this->row, 'destinationproperty');
  $this
    ->assertSame($flattened, array(
    1,
    2,
    3,
    4,
    5,
    7,
    8,
  ));
}