/** * @param object $entity */ protected function fillData($entity) { $data = $this->storage->get(); $this->storage->remove(); if (!$data) { return; } if (!empty($data[ProductDataStorage::ENTITY_DATA_KEY]) && is_array($data[ProductDataStorage::ENTITY_DATA_KEY])) { $this->fillEntityData($entity, $data[ProductDataStorage::ENTITY_DATA_KEY]); } if (!empty($data[ProductDataStorage::ENTITY_ITEMS_DATA_KEY]) && is_array($data[ProductDataStorage::ENTITY_ITEMS_DATA_KEY])) { $itemsData = $data[ProductDataStorage::ENTITY_ITEMS_DATA_KEY]; $this->fillItemsData($entity, $itemsData); } }
public function testRemove() { $this->session->expects($this->once())->method('remove')->with(ProductDataStorage::PRODUCT_DATA_KEY); $this->storage->remove(); }