/** * Prepare data from text to values * * @param FixtureInterface $fixture * @return array */ protected function prepareData(FixtureInterface $fixture) { $categoryId = $fixture->getDataFieldConfig('root_category_id')['source']->getCategory()->getId(); $websiteId = $fixture->getDataFieldConfig('website_id')['source']->getWebsite()->getWebsiteId(); $data = ['group' => ['name' => $fixture->getName(), 'root_category_id' => $categoryId, 'website_id' => $websiteId, 'group_id' => $fixture->hasData('group_id') ? $fixture->getGroupId() : ''], 'store_action' => 'add', 'store_type' => 'group']; return $data; }