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

Issue #3400982: Save and force reload node entity being used for testing

parent 387fee94
No related branches found
No related tags found
1 merge request!80Resolve #3400982 "Field processor plugins"
......@@ -76,6 +76,11 @@ abstract class FieldProcessorTestBase extends KernelTestBase {
$node->save();
// Force reload the node from database to make sure we're dealing with a
// real field data and not something we've just put in there.
\Drupal::entityTypeManager()->getStorage('node')->resetCache();
$node = Node::load($node->id());
$this->assertExportedValueEquals(
$expectedExportOutput,
$this->getFieldProcessor()->exportFieldValue($node->get('field_test_field')),
......@@ -113,6 +118,12 @@ abstract class FieldProcessorTestBase extends KernelTestBase {
]);
$this->getFieldProcessor()->importFieldValue($node, 'field_test_field', $dataToImport);
$node->save();
// Force reload the node from database; otherwise we'll get just same
// values as we've set above.
\Drupal::entityTypeManager()->getStorage('node')->resetCache();
$node = Node::load($node->id());
$this->assertImportedValueEquals(
$expectedFieldValue,
......
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