/**
  * 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();
 }
 /**
  * Update New StoreGroup
  *
  * @param StoreGroup $storeGroupOrigin
  * @param StoreGroup $storeGroup
  * @return void
  */
 public function test(StoreGroup $storeGroupOrigin, StoreGroup $storeGroup)
 {
     //Preconditions
     $storeGroupOrigin->persist();
     //Steps
     $this->storeIndex->open();
     $this->storeIndex->getStoreGrid()->searchAndOpenStoreGroup($storeGroupOrigin);
     $this->editGroup->getEditFormGroup()->fill($storeGroup);
     $this->editGroup->getFormPageActions()->save();
 }
 /**
  * Update Website
  *
  * @param Website $websiteOrigin
  * @param Website $website
  * @return array
  */
 public function test(Website $websiteOrigin, Website $website)
 {
     //Preconditions
     $websiteOrigin->persist();
     //Steps
     $this->storeIndex->open();
     $this->storeIndex->getStoreGrid()->searchAndOpenWebsite($websiteOrigin);
     $this->editWebsite->getEditFormWebsite()->fill($website);
     $this->editWebsite->getFormPageActions()->save();
     return ['website' => $this->mergeFixture($website, $websiteOrigin)];
 }
 /**
  * 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();
 }
 /**
  * Delete Website
  *
  * @param Website $website
  * @param string $createBackup
  * @return void
  */
 public function test(Website $website, $createBackup)
 {
     //Preconditions
     $website->persist();
     $this->backupIndex->open()->getBackupGrid()->massaction([], 'Delete', true, 'Select All');
     //Steps
     $this->storeIndex->open();
     $this->storeIndex->getStoreGrid()->searchAndOpenWebsite($website);
     $this->editWebsite->getFormPageActions()->delete();
     $this->deleteWebsite->getDeleteWebsiteForm()->fillForm(['create_backup' => $createBackup]);
     $this->deleteWebsite->getFormPageActions()->delete();
 }
 /**
  * Delete Store after test.
  *
  * @return void|null
  */
 public function tearDown()
 {
     if (in_array($this->storeName, $this->skippedStores)) {
         return;
     }
     $storeName = explode("/", $this->storeName);
     $filter['store_title'] = end($storeName);
     $this->storeIndex->open();
     $this->storeIndex->getStoreGrid()->searchAndOpen($filter);
     $this->storeNew->getFormPageActions()->delete();
     $this->storeDelete->getStoreForm()->fillForm(['create_backup' => 'No']);
     $this->storeDelete->getFormPageActions()->delete();
 }
 /**
  * Assert that created Store Group can not be found in Stores grid by name
  *
  * @param StoreIndex $storeIndex
  * @param StoreGroup $storeGroup
  * @return void
  */
 public function processAssert(StoreIndex $storeIndex, StoreGroup $storeGroup)
 {
     $storeGroupName = $storeGroup->getName();
     $storeIndex->open()->getStoreGrid()->search(['group_title' => $storeGroupName]);
     \PHPUnit_Framework_Assert::assertFalse($storeIndex->getStoreGrid()->isStoreExists($storeGroupName), 'Store group \'' . $storeGroupName . '\' is present in grid.');
 }
 /**
  * Assert that created Website can't be found in grid by name
  *
  * @param StoreIndex $storeIndex
  * @param Website $website
  * @return void
  */
 public function processAssert(StoreIndex $storeIndex, Website $website)
 {
     $websiteName = $website->getName();
     $storeIndex->open()->getStoreGrid()->search(['website_title' => $websiteName]);
     \PHPUnit_Framework_Assert::assertFalse($storeIndex->getStoreGrid()->isWebsiteExists($website), 'Website \'' . $websiteName . '\' is present in grid.');
 }
 /**
  * Assert that created Store View can be found in Stores grid by name
  *
  * @param StoreIndex $storeIndex
  * @param Store $store
  * @return void
  */
 public function processAssert(StoreIndex $storeIndex, Store $store)
 {
     $storeName = $store->getName();
     $storeIndex->open()->getStoreGrid()->search(['store_title' => $storeName]);
     \PHPUnit_Framework_Assert::assertTrue($storeIndex->getStoreGrid()->isStoreExists($storeName), 'Store \'' . $storeName . '\' is not present in grid.');
 }