public function testAddAdditionalDataToBasketSet()
 {
     $basketItemSet = new Basket\BasketSet('123', array('image_url' => 'www', 'description' => 'Test'));
     $this->assertEquals('Test', $basketItemSet->getDescription());
     $this->assertCount(2, $basketItemSet->getAdditionalData());
 }
 /**
  * @param BasketSet $basketSet
  *
  * @return $this
  */
 public function updateItemSet(BasketSet $basketSet)
 {
     $items = $basketSet->getItems();
     if (empty($items)) {
         throw new \InvalidArgumentException('BasketSet needs at least one item');
     }
     $setItems = array();
     foreach ($items as $subItem) {
         $item = array('variant_id' => $subItem->getVariantId(), 'app_id' => $subItem->getAppId());
         $additionalData = $subItem->getAdditionalData();
         if (!empty($additionalData)) {
             $this->checkAdditionData($additionalData);
             $item['additional_data'] = (array) $additionalData;
         }
         $setItems[] = $item;
     }
     $set = array('additional_data' => (array) $basketSet->getAdditionalData(), 'set_items' => $setItems);
     $setId = $basketSet->getId();
     if ($setId) {
         $set['id'] = $setId;
         $this->updatedItems[$setId] = $set;
     } else {
         $this->updatedItems[] = $set;
     }
     return $this;
 }