Version 1
[yaffs-website] / web / core / modules / migrate / tests / src / Unit / process / FlattenTest.php
1 <?php
2
3 namespace Drupal\Tests\migrate\Unit\process;
4 use Drupal\migrate\Plugin\migrate\process\Flatten;
5
6
7 /**
8  * Tests the flatten plugin.
9  *
10  * @group migrate
11  */
12 class FlattenTest extends MigrateProcessTestCase {
13
14   /**
15    * Test that various array flatten operations work properly.
16    */
17   public function testFlatten() {
18     $plugin = new Flatten([], 'flatten', []);
19     $flattened = $plugin->transform([1, 2, [3, 4, [5]], [], [7, 8]], $this->migrateExecutable, $this->row, 'destinationproperty');
20     $this->assertSame($flattened, [1, 2, 3, 4, 5, 7, 8]);
21   }
22
23 }