public function NullCoalesceTest::transformDataProvider in Drupal 9
Same name and namespace in other branches
- 8 core/modules/migrate/tests/src/Unit/process/NullCoalesceTest.php \Drupal\Tests\migrate\Unit\process\NullCoalesceTest::transformDataProvider()
Provides Data for ::testTransform.
File
- core/
modules/ migrate/ tests/ src/ Unit/ process/ NullCoalesceTest.php, line 50
Class
- NullCoalesceTest
- Tests the null_coalesce process plugin.
Namespace
Drupal\Tests\migrate\Unit\processCode
public function transformDataProvider() {
return [
'all null' => [
'source' => [
NULL,
NULL,
NULL,
],
'expected_result' => NULL,
],
'false first' => [
'source' => [
FALSE,
NULL,
NULL,
],
'expected_result' => FALSE,
],
'no null' => [
'source' => [
'test',
'test2',
],
'expected_result' => 'test',
],
'string first' => [
'source' => [
'test',
NULL,
'test2',
],
'expected_result' => 'test',
],
'empty string' => [
'source' => [
NULL,
'',
NULL,
],
'expected_result' => '',
],
'array' => [
'source' => [
NULL,
NULL,
[
1,
2,
3,
],
],
'expected_result' => [
1,
2,
3,
],
],
];
}