public function PathSetTranslatedTest::transformDataProvider in Drupal 9
Same name and namespace in other branches
- 8 core/modules/path/tests/src/Unit/migrate/process/PathSetTranslatedTest.php \Drupal\Tests\path\Unit\migrate\process\PathSetTranslatedTest::transformDataProvider()
Provides data for the testTransform method.
Return value
array The data.
File
- core/
modules/ path/ tests/ src/ Unit/ migrate/ process/ PathSetTranslatedTest.php, line 41
Class
- PathSetTranslatedTest
- Tests the path_set_translated process plugin.
Namespace
Drupal\Tests\path\Unit\migrate\processCode
public function transformDataProvider() {
return [
'non-node-path' => [
'path' => '/non-node-path',
'node_translation' => [
1,
'en',
],
'expected_result' => '/non-node-path',
],
'no_translated_node_1' => [
'path' => '/node/1',
'node_translation' => 'INVALID_NID',
'expected_result' => '/node/1',
],
'no_translated_node_2' => [
'path' => '/node/1',
'node_translation' => NULL,
'expected_result' => '/node/1',
],
'no_translated_node_3' => [
'path' => '/node/1',
'node_translation' => FALSE,
'expected_result' => '/node/1',
],
'valid_transform' => [
'path' => '/node/1',
'node_translation' => [
3,
'en',
],
'expected_result' => '/node/3',
],
];
}