Skip to content
Snippets Groups Projects
Commit a363a236 authored by Vadym Abramchuk's avatar Vadym Abramchuk
Browse files

Issue #3400982: Simplify expected field value handling

parent 7dad5361
No related branches found
No related tags found
1 merge request!80Resolve #3400982 "Field processor plugins"
......@@ -108,8 +108,11 @@ abstract class FieldProcessorTestBase extends KernelTestBase {
public function testImportFieldValue(
array $fieldStorageDefinition,
mixed $dataToImport,
mixed $expectedFieldValue,
mixed $expectedFieldValue = NULL
): void {
if ($expectedFieldValue === NULL) {
$expectedFieldValue = $dataToImport;
}
$this->prepareNodeTypeWithField($fieldStorageDefinition);
$node = Node::create([
......
......@@ -24,7 +24,6 @@ class SimpleFieldProcessorTest extends FieldProcessorTestBase {
],
],
[0 => ['value' => 'hello']],
[0 => ['value' => 'hello']],
],
// Multivalued field test; there is just one for string since other field
// types share the same code/logic and there's no sense in testing them
......@@ -38,14 +37,12 @@ class SimpleFieldProcessorTest extends FieldProcessorTestBase {
'cardinality' => FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED,
],
[0 => ['value' => 'hello once'], 1 => ['value' => 'hello again']],
[0 => ['value' => 'hello once'], 1 => ['value' => 'hello again']],
],
'string_long' => [
[
'type' => 'string_long',
],
[0 => ['value' => 'hello']],
[0 => ['value' => 'hello']],
],
];
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment