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

Issue #3400982: Add multi-valued string and string_long tests

parent 3c385464
No related branches found
No related tags found
1 merge request!80Resolve #3400982 "Field processor plugins"
......@@ -2,6 +2,8 @@
namespace Drupal\Tests\single_content_sync\Kernel\FieldProcessor;
use Drupal\Core\Field\FieldStorageDefinitionInterface;
/**
* @coversDefaultClass \Drupal\single_content_sync\Plugin\SingleContentSyncFieldProcessor\SimpleField
*
......@@ -24,6 +26,27 @@ 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
// all.
'multivalued string' => [
[
'type' => 'string',
'settings' => [
'max_length' => 255,
],
'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']],
],
];
}
......@@ -42,6 +65,24 @@ class SimpleFieldProcessorTest extends FieldProcessorTestBase {
'hello',
[0 => ['value' => 'hello']],
],
'multivalued string' => [
[
'type' => 'string',
'settings' => [
'max_length' => 255,
],
'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',
],
'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