/** * Update Synonym Group. * * @param SynonymGroup $initialSynonymGroup * @return void */ public function test(SynonymGroup $initialSynonymGroup) { //precondition $initialSynonymGroup->persist(); $initialData = $initialSynonymGroup->getData(); $synonyms = $initialData['synonyms']; // Steps $this->synonymGroupIndex->open(); $this->synonymGroupIndex->getSynonymGroupGrid()->searchAndOpen(['synonyms' => $synonyms]); $this->synonymGroupNew->getFormPageActions()->delete(); $this->synonymGroupNew->getModalBlock()->acceptAlert(); }
/** * Update Synonym Group. * * @param SynonymGroup $initialSynonymGroup * @param SynonymGroup $synonymGroup * @return void */ public function test(SynonymGroup $initialSynonymGroup, SynonymGroup $synonymGroup) { //precondition $initialSynonymGroup->persist(); $initialData = $initialSynonymGroup->getData(); $synonyms = $initialData['synonyms']; // Steps $this->synonymGroupIndex->open(); $this->synonymGroupIndex->getSynonymGroupGrid()->searchAndOpen(['synonyms' => $synonyms]); $this->synonymGroupNew->getSynonymGroupForm()->fill($synonymGroup); $this->synonymGroupNew->getFormPageActions()->save(); }
/** * Merge Synonym Group. * * @param SynonymGroup $initialSynonymGroup * @param SynonymGroup $synonymGroup * @return void */ public function test(SynonymGroup $initialSynonymGroup, SynonymGroup $synonymGroup) { //precondition $initialSynonymGroup->persist(); $initialData = $initialSynonymGroup->getData(); $synonyms = $initialData['synonyms']; $synonyms = explode(',', $synonyms); $data = $synonymGroup->getData(); $data['synonyms'] = $synonyms[0] . ',' . $data['synonyms']; $data['scope_id'] = ['dataset' => 'default_store_view']; $synonymGroup = $this->factory->createByCode('synonymGroup', ['data' => $data]); // Steps $this->synonymGroupIndex->open(); $this->synonymGroupIndex->getGridPageActions()->addNew(); $this->synonymGroupNew->getSynonymGroupForm()->fill($synonymGroup); $this->synonymGroupNew->getFormPageActions()->save(); }