function NullCoalesceTest::testTransform

Same name in other branches
  1. 9 core/modules/migrate/tests/src/Unit/process/NullCoalesceTest.php \Drupal\Tests\migrate\Unit\process\NullCoalesceTest::testTransform()
  2. 8.9.x core/modules/migrate/tests/src/Unit/process/NullCoalesceTest.php \Drupal\Tests\migrate\Unit\process\NullCoalesceTest::testTransform()
  3. 10 core/modules/migrate/tests/src/Unit/process/NullCoalesceTest.php \Drupal\Tests\migrate\Unit\process\NullCoalesceTest::testTransform()

Tests null_coalesce.

@covers ::transform

@dataProvider transformDataProvider

Parameters

array $source: The source value.

mixed $expected_result: The expected result.

Throws

\Drupal\migrate\MigrateException

File

core/modules/migrate/tests/src/Unit/process/NullCoalesceTest.php, line 43

Class

NullCoalesceTest
Tests the null_coalesce process plugin.

Namespace

Drupal\Tests\migrate\Unit\process

Code

public function testTransform(array $source, $expected_result) : void {
    $plugin = new NullCoalesce([], 'null_coalesce', []);
    $result = $plugin->transform($source, $this->migrateExecutable, $this->row, 'destination_property');
    $this->assertSame($expected_result, $result);
}

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