/** * 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(); }