class FlattenTest
Same name and namespace in other branches
- 11.x core/modules/migrate/tests/src/Unit/process/FlattenTest.php \Drupal\Tests\migrate\Unit\process\FlattenTest
- 10 core/modules/migrate/tests/src/Unit/process/FlattenTest.php \Drupal\Tests\migrate\Unit\process\FlattenTest
- 9 core/modules/migrate/tests/src/Unit/process/FlattenTest.php \Drupal\Tests\migrate\Unit\process\FlattenTest
Tests the flatten plugin.
@group migrate
Hierarchy
- class \Drupal\Tests\UnitTestCase uses \Drupal\Tests\PhpunitCompatibilityTrait extends \PHPUnit\Framework\TestCase
- class \Drupal\Tests\migrate\Unit\MigrateTestCase extends \Drupal\Tests\UnitTestCase
- class \Drupal\Tests\migrate\Unit\process\MigrateProcessTestCase extends \Drupal\Tests\migrate\Unit\MigrateTestCase
- class \Drupal\Tests\migrate\Unit\process\FlattenTest extends \Drupal\Tests\migrate\Unit\process\MigrateProcessTestCase
- class \Drupal\Tests\migrate\Unit\process\MigrateProcessTestCase extends \Drupal\Tests\migrate\Unit\MigrateTestCase
- class \Drupal\Tests\migrate\Unit\MigrateTestCase extends \Drupal\Tests\UnitTestCase
Expanded class hierarchy of FlattenTest
File
-
core/
modules/ migrate/ tests/ src/ Unit/ process/ FlattenTest.php, line 12
Namespace
Drupal\Tests\migrate\Unit\processView source
class FlattenTest extends MigrateProcessTestCase {
/**
* Test that various array flatten operations work properly.
*/
public function testFlatten() {
$plugin = new Flatten([], 'flatten', []);
$flattened = $plugin->transform([
1,
2,
[
3,
4,
[
5,
],
],
[],
[
7,
8,
],
], $this->migrateExecutable, $this->row, 'destination_property');
$this->assertSame([
1,
2,
3,
4,
5,
7,
8,
], $flattened);
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.