Ejemplo n.º 1
0
 /**
  * Create customer
  *
  * @return array
  */
 public function run()
 {
     if ($this->persistCustomer) {
         $this->customer->persist();
     }
     return ['customer' => $this->customer];
 }
 /**
  * Injection data
  *
  * @param CustomerAccountCreate $customerAccountCreate
  * @param CustomerAccountLogout $customerAccountLogout
  * @param CmsIndex $cmsIndex
  * @param CustomerInjectable $customer
  * @return array
  */
 public function __inject(CustomerAccountCreate $customerAccountCreate, CustomerAccountLogout $customerAccountLogout, CmsIndex $cmsIndex, CustomerInjectable $customer)
 {
     $this->customerAccountLogout = $customerAccountLogout;
     $this->customerAccountCreate = $customerAccountCreate;
     $this->cmsIndex = $cmsIndex;
     //Precondition
     $customer->persist();
     return ['customer' => $customer];
 }
 /**
  * Runs Delete Customer Backend Entity test
  *
  * @param CustomerInjectable $customer
  * @return void
  */
 public function testDeleteCustomerBackendEntity(CustomerInjectable $customer)
 {
     // Preconditions:
     $customer->persist();
     // Steps:
     $filter = ['email' => $customer->getEmail()];
     $this->customerIndexPage->open();
     $this->customerIndexPage->getCustomerGridBlock()->searchAndOpen($filter);
     $this->customerIndexEditPage->getPageActionsBlock()->delete();
 }
 /**
  * @param CustomerInjectable $initialCustomer
  * @param CustomerInjectable $customer
  * @param AddressInjectable $address
  */
 public function testUpdateCustomerBackendEntity(CustomerInjectable $initialCustomer, CustomerInjectable $customer, AddressInjectable $address)
 {
     // Prepare data
     $address = $address->hasData() ? $address : null;
     // Preconditions:
     $initialCustomer->persist();
     // Steps
     $filter = ['email' => $initialCustomer->getEmail()];
     $this->customerIndexPage->open();
     $this->customerIndexPage->getCustomerGridBlock()->searchAndOpen($filter);
     $this->customerIndexEditPage->getCustomerForm()->updateCustomer($customer, $address);
     $this->customerIndexEditPage->getPageActionsBlock()->save();
 }
 /**
  * Prepare data
  *
  * @param CustomerInjectable $customer
  * @return array
  */
 public function __prepare(CustomerInjectable $customer)
 {
     $customer->persist();
     return ['customer' => $customer];
 }
Ejemplo n.º 6
0
 /**
  * Prepare data
  *
  * @param FixtureFactory $fixtureFactory
  * @param CustomerInjectable $customer
  * @return void
  */
 public function __prepare(FixtureFactory $fixtureFactory, CustomerInjectable $customer)
 {
     $this->fixtureFactory = $fixtureFactory;
     $customer->persist();
     $this->customer = $customer;
 }
 /**
  * New Accounts Report
  *
  * @param CustomerInjectable $customer
  * @param array $customersReport
  * @return void
  */
 public function test(CustomerInjectable $customer, array $customersReport)
 {
     // Preconditions
     $this->customerIndexPage->open();
     $this->customerIndexPage->getCustomerGridBlock()->massaction([], 'Delete', true, 'Select All');
     $customer->persist();
     // Steps
     $this->customerAccounts->open();
     $this->customerAccounts->getGridBlock()->searchAccounts($customersReport);
 }
 /**
  * Prepare data
  *
  * @param CustomerInjectable $customer
  * @param CatalogProductSimple $product
  * @return array
  */
 public function __prepare(CustomerInjectable $customer, CatalogProductSimple $product)
 {
     $customer->persist();
     $product->persist();
     return ['customer' => $customer, 'product' => $product];
 }
 /**
  * Runs Delete Customer Address test
  *
  * @param CustomerInjectable $customer
  * @return array
  */
 public function test(CustomerInjectable $customer)
 {
     // Precondition:
     $customer->persist();
     $addressToDelete = $customer->getDataFieldConfig('address')['source']->getAddresses()[1];
     // Steps:
     $this->cmsIndex->open();
     $this->cmsIndex->getLinksBlock()->openLink("Log In");
     $this->customerAccountLogin->getLoginBlock()->login($customer);
     $this->customerAccountIndex->getAccountMenuBlock()->openMenuItem('Address Book');
     $this->customerAccountIndex->getAdditionalAddressBlock()->deleteAdditionalAddress($addressToDelete);
     return ['deletedAddress' => $addressToDelete];
 }
Ejemplo n.º 10
0
 /**
  * Run Update Customer Entity test
  *
  * @param CustomerInjectable $initialCustomer
  * @param CustomerInjectable $customer
  * @param AddressInjectable $address
  * @param AssertCustomerInfoSuccessSavedMessage $assertCustomerInfoSuccessSavedMessage
  * @return void
  */
 public function test(CustomerInjectable $initialCustomer, CustomerInjectable $customer, AddressInjectable $address, AssertCustomerInfoSuccessSavedMessage $assertCustomerInfoSuccessSavedMessage)
 {
     // Preconditions
     $initialCustomer->persist();
     // Steps
     $this->cmsIndex->open();
     $this->cmsIndex->getLinksBlock()->openLink('Log In');
     $this->customerAccountLogin->getLoginBlock()->fill($initialCustomer);
     $this->customerAccountLogin->getLoginBlock()->submit();
     $this->customerAccountIndex->getInfoBlock()->openEditContactInfo();
     $this->customerAccountEdit->getAccountInfoForm()->fill($customer);
     $this->customerAccountEdit->getAccountInfoForm()->submit();
     \PHPUnit_Framework_Assert::assertThat($this->getName(), $assertCustomerInfoSuccessSavedMessage);
     $this->customerAccountIndex->getDashboardAddress()->editBillingAddress();
     $this->customerAddressEdit->getEditForm()->fill($address);
     $this->customerAddressEdit->getEditForm()->saveAddress();
 }