public function testStoreAndRetrieveDocument()
{
$attribute1 = new Attribute();
$attribute1->key = 'foo';
$attribute1->value = 'bar';
$attribute2 = new Attribute();
$attribute2->key = 'weights';
$attribute2->value = [34, 67];
$attributes = [$attribute1, $attribute2];
$product = new Product();
$product->name = 'My product';
$product->attributes = $attributes;
$manager = self::$kernel->getContainer()->get('doctrine')->getManagerForClass(Product::class);
$manager->persist($product);
$manager->flush();
$manager->clear();
$retrievedProduct = $manager->find(Product::class, $product->id);
$this->assertEquals($attributes, $retrievedProduct->attributes);
}