public function NullCoalesceTest::transformWithDefaultProvider in Drupal 9
Provides Data for ::testTransformWithDefault.
File
- core/
modules/ migrate/ tests/ src/ Unit/ process/ NullCoalesceTest.php, line 104
Class
- NullCoalesceTest
- Tests the null_coalesce process plugin.
Namespace
Drupal\Tests\migrate\Unit\processCode
public function transformWithDefaultProvider() {
return [
'default not used' => [
'source' => [
NULL,
NULL,
'Test',
'Test 2',
],
'default_value' => 'default',
'expected_result' => 'Test',
],
'default string' => [
'source' => [
NULL,
NULL,
],
'default_value' => 'default',
'expected_result' => 'default',
],
'default NULL' => [
'source' => [
NULL,
NULL,
],
'default_value' => NULL,
'expected_result' => NULL,
],
];
}