Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
single_content_sync
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
single_content_sync
Commits
a363a236
Commit
a363a236
authored
1 year ago
by
Vadym Abramchuk
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#3400982
: Simplify expected field value handling
parent
7dad5361
No related branches found
Branches containing commit
No related tags found
1 merge request
!80
Resolve #3400982 "Field processor plugins"
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
tests/src/Kernel/FieldProcessor/FieldProcessorTestBase.php
+4
-1
4 additions, 1 deletion
tests/src/Kernel/FieldProcessor/FieldProcessorTestBase.php
tests/src/Kernel/FieldProcessor/SimpleFieldProcessorTest.php
+0
-3
0 additions, 3 deletions
tests/src/Kernel/FieldProcessor/SimpleFieldProcessorTest.php
with
4 additions
and
4 deletions
tests/src/Kernel/FieldProcessor/FieldProcessorTestBase.php
+
4
−
1
View file @
a363a236
...
...
@@ -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
([
...
...
This diff is collapsed.
Click to expand it.
tests/src/Kernel/FieldProcessor/SimpleFieldProcessorTest.php
+
0
−
3
View file @
a363a236
...
...
@@ -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'
]],
],
];
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment