/**
* @internal
*
* @covers \Shopware\Core\Framework\DataAbstractionLayer\EntityCollection
*/
class EntityCollectionTest extends TestCase
{ public function testSetCustomFields(): void
{ $collection =
new EntityCollection([ new MyCollectionEntity('element-1',
['foo' => 1, 'bar' => 1
]),
new MyCollectionEntity('element-2',
['foo' => 2, 'bar' => 2
]),
]);
$collection->
setCustomFields([ 'element-1' =>
['foo' => 3, 'bar' => 3, 'baz' => 3
],
'element-2' =>
['foo' => 4, 'bar' => 4
],
'not-exists' =>
['foo' => 5
],
]);
static::
assertEquals([ 'element-1' =>
['foo' => 3, 'bar' => 3, 'baz' => 3
],