$serializer =
new EntitySerializer();
$serializerRegistry =
$this->
getContainer()->
get(SerializerRegistry::
class);
$serializer->
setRegistry($serializerRegistry);
$return =
$serializer->
deserialize(new Config([],
[],
[]),
$productDefinition,
$importData);
$return = \
is_array($return) ?
$return :
iterator_to_array($return);
static::
assertSame($expectedData,
$return);
} public function testEnsureIdFieldsWithInvalidCharacter(): void
{ static::
expectExceptionObject(new InvalidIdentifierException('invalid|string_with_pipe'
));
/** @var EntityDefinition $productDefinition */
$productDefinition =
$this->
getContainer()->
get(ProductDefinition::
class);
[$expectedData,
$importData] =
require __DIR__ . '/../../../fixtures/ensure_ids_for_products.php';
$importData['id'
] = 'invalid|string_with_pipe';
$serializer =
new EntitySerializer();
$serializerRegistry =
$this->
getContainer()->
get(SerializerRegistry::
class);
$serializer->
setRegistry($serializerRegistry);
$return =
$serializer->
deserialize(new Config([],
[],
[]),
$productDefinition,
$importData);