/**
  * Create customer on backend.
  *
  * @param Customer $customer
  * @param string $customerAction
  * @param Address $address
  * @return void
  */
 public function test(Customer $customer, $customerAction, Address $address = null)
 {
     // Steps
     $this->pageCustomerIndex->open();
     $this->pageCustomerIndex->getPageActionsBlock()->addNew();
     $this->pageCustomerIndexNew->getCustomerForm()->fillCustomer($customer, $address);
     $this->pageCustomerIndexNew->getPageActionsBlock()->{$customerAction}();
 }
 /**
  * Create customer on backend.
  *
  * @param Customer $customer
  * @param Address $address
  * @param string $customerAction
  * @return void
  */
 public function test(Customer $customer, Address $address, $customerAction)
 {
     // Prepare data
     $address = $address->hasData() ? $address : null;
     // Steps
     $this->pageCustomerIndex->open();
     $this->pageCustomerIndex->getPageActionsBlock()->addNew();
     $this->pageCustomerIndexNew->getCustomerForm()->fillCustomer($customer, $address);
     $this->pageCustomerIndexNew->getPageActionsBlock()->{$customerAction}();
 }
 /**
  * Create customer on backend.
  *
  * @param Customer $customer
  * @return void
  */
 public function test(Customer $customer)
 {
     // Precondition
     $customer->persist();
     // Steps
     $this->pageCustomerIndex->open();
     $this->pageCustomerIndex->getPageActionsBlock()->addNew();
     $this->pageCustomerIndexNew->getCustomerForm()->fillCustomer($customer);
     $this->pageCustomerIndexNew->getPageActionsBlock()->save();
 }
 /**
  * @param CustomerInjectable $customer
  * @param AddressInjectable $address
  */
 public function testCreateCustomerBackendEntity(CustomerInjectable $customer, AddressInjectable $address)
 {
     // Prepare data
     $address = $address->hasData() ? $address : null;
     // Steps
     $this->pageCustomerIndex->open();
     $this->pageCustomerIndex->getPageActionsBlock()->addNew();
     $this->pageCustomerIndexNew->getCustomerForm()->fillCustomer($customer, $address);
     $this->pageCustomerIndexNew->getPageActionsBlock()->save();
 }
 /**
  * Assert that customer group find on account information page.
  *
  * @param FixtureFactory $fixtureFactory
  * @param CustomerGroup $customerGroup
  * @param CustomerIndexNew $customerIndexNew
  * @param CustomerIndex $customerIndex
  * @return void
  */
 public function processAssert(FixtureFactory $fixtureFactory, CustomerGroup $customerGroup, CustomerIndexNew $customerIndexNew, CustomerIndex $customerIndex)
 {
     /** @var Customer $customer */
     $customer = $fixtureFactory->createByCode('customer', ['dataset' => 'defaultBackend', 'data' => ['group_id' => ['customerGroup' => $customerGroup]]]);
     $filter = ['email' => $customer->getEmail()];
     $customerIndexNew->open();
     $customerIndexNew->getCustomerForm()->fillCustomer($customer);
     $customerIndexNew->getPageActionsBlock()->save();
     $customerIndex->getCustomerGridBlock()->searchAndOpen($filter);
     $customerFormData = $customerIndexNew->getCustomerForm()->getData($customer);
     $customerFixtureData = $customer->getData();
     $diff = array_diff($customerFixtureData, $customerFormData);
     \PHPUnit_Framework_Assert::assertTrue(empty($diff), "Customer group {$customerGroup->getCustomerGroupCode()} not in account information page.");
 }