You are here

FlattenTest.php in Zircon Profile 8

Same filename and directory in other branches
  1. 8.0 core/modules/migrate/tests/src/Unit/process/FlattenTest.php

File

core/modules/migrate/tests/src/Unit/process/FlattenTest.php
View source
<?php

/**
 * @file
 * Contains \Drupal\Tests\migrate\Unit\process\FlattenTest.
 */
namespace Drupal\Tests\migrate\Unit\process;

use Drupal\migrate\Plugin\migrate\process\Flatten;

/**
 * Tests the flatten plugin.
 *
 * @group migrate
 */
class FlattenTest extends MigrateProcessTestCase {

  /**
   * Test that various array flatten operations work properly.
   */
  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,
    ));
  }

}

Classes

Namesort descending Description
FlattenTest Tests the flatten plugin.