コード例 #1
0
 /**
  * Create customer group
  *
  * @param CustomerGroup $customerGroup
  */
 public function testCreateCustomerGroup(CustomerGroup $customerGroup)
 {
     //Steps
     $this->customerGroupIndex->open();
     $this->customerGroupIndex->getGridPageActions()->addNew();
     $this->customerGroupNew->getPageMainForm()->fill($customerGroup);
     $this->customerGroupNew->getPageMainActions()->save();
 }
コード例 #2
0
 /**
  * Delete Customer Group
  *
  * @param CustomerGroupInjectable $customerGroup
  * @return void
  */
 public function test(CustomerGroupInjectable $customerGroup)
 {
     // Precondition
     $customerGroup->persist();
     // Steps
     $filter = ['code' => $customerGroup->getCustomerGroupCode()];
     $this->customerGroupIndex->open();
     $this->customerGroupIndex->getCustomerGroupGrid()->searchAndOpen($filter);
     $this->customerGroupNew->getPageMainActions()->delete();
 }
コード例 #3
0
 /**
  * Update Customer Group
  *
  * @param CustomerGroupInjectable $customerGroupOriginal
  * @param CustomerGroupInjectable $customerGroup
  * @return void
  */
 public function test(CustomerGroupInjectable $customerGroupOriginal, CustomerGroupInjectable $customerGroup)
 {
     // Precondition
     $customerGroupOriginal->persist();
     $filter = ['code' => $customerGroupOriginal->getCustomerGroupCode()];
     // Steps
     $this->customerGroupIndex->open();
     $this->customerGroupIndex->getCustomerGroupGrid()->searchAndOpen($filter);
     $this->customerGroupNew->getPageMainForm()->fill($customerGroup);
     $this->customerGroupNew->getPageMainActions()->save();
 }
コード例 #4
0
 /**
  * Delete Customer Group.
  *
  * @param CustomerGroup $customerGroup
  * @param Customer $customer [optional]
  * @return array
  */
 public function test(CustomerGroup $customerGroup, Customer $customer = null)
 {
     // Precondition
     if ($customer !== null) {
         $customer->persist();
         $customerGroup = $customer->getDataFieldConfig('group_id')['source']->getCustomerGroup();
     } else {
         $customerGroup->persist();
     }
     // Steps
     $filter = ['code' => $customerGroup->getCustomerGroupCode()];
     $this->customerGroupIndex->open();
     $this->customerGroupIndex->getCustomerGroupGrid()->searchAndOpen($filter);
     $this->customerGroupNew->getPageMainActions()->delete();
     $this->customerGroupNew->getModalBlock()->acceptAlert();
     return ['customer' => $customer, 'customerGroup' => $customerGroup];
 }