/** * Update Custom System Variable Entity test. * * @param FixtureFactory $fixtureFactory * @param SystemVariable $customVariable * @param SystemVariable $customVariableOrigin * @param string $saveAction * @return array */ public function test(FixtureFactory $fixtureFactory, SystemVariable $customVariable, SystemVariable $customVariableOrigin, $saveAction) { $this->store = $fixtureFactory->createByCode('store', ['dataset' => 'custom']); $this->store->persist(); $customVariableOrigin->persist(); $filter = ['code' => $customVariableOrigin->getCode()]; // Steps $this->systemVariableIndexPage->open(); $this->systemVariableIndexPage->getSystemVariableGrid()->searchAndOpen($filter); $this->systemVariableNewPage->getFormPageActions()->selectStoreView($this->store->getData('name')); $this->systemVariableNewPage->getSystemVariableForm()->fill($customVariable); $this->systemVariableNewPage->getFormPageActions()->{$saveAction}(); return ['storeOrigin' => $this->store, 'customVariableOrigin' => $customVariableOrigin]; }
/** * Runs Update Store Entity test * * @param Store $storeInitial * @param Store $store * @return void */ public function test(Store $storeInitial, Store $store) { // Preconditions: $storeInitial->persist(); // Steps: $this->storeIndex->open(); $this->storeIndex->getStoreGrid()->searchAndOpenStore($storeInitial); $this->editStore->getStoreForm()->fill($store); $this->editStore->getFormPageActions()->save(); }
/** * Run Delete Store Entity test * * @param Store $store * @param string $createBackup * @return void */ public function test(Store $store, $createBackup) { // Preconditions: $store->persist(); $this->backupIndex->open()->getBackupGrid()->massaction([], 'Delete', true, 'Select All'); // Steps: $this->storeIndex->open(); $this->storeIndex->getStoreGrid()->searchAndOpenStore($store); $this->editStore->getFormPageActions()->delete(); $this->storeDelete->getStoreForm()->fillForm(['create_backup' => $createBackup]); $this->storeDelete->getFormPageFooterActions()->delete(); }
/** * Prepare data * * @param Store $storeOrigin * @return array */ public function __prepare(Store $storeOrigin) { $storeOrigin->persist(); self::$storeName = $storeOrigin->getName(); return ['storeOrigin' => $storeOrigin]; }