/**
  * @param ObjectManager $manager
  * @param string $name
  * @return CustomerGroup
  */
 protected function createGroup(ObjectManager $manager, $name)
 {
     $group = new CustomerGroup();
     $group->setName($name);
     $manager->persist($group);
     $this->addReference($name, $group);
     return $group;
 }
 /**
  * @return array
  */
 public function submitDataProvider()
 {
     $groupName = 'customer_group_name';
     $alteredGroupName = 'altered_group_name';
     $defaultGroup = new CustomerGroup();
     $defaultGroup->setName($groupName);
     /** @var CustomerGroup $existingGroupBefore */
     $existingGroupBefore = $this->getEntity(self::DATA_CLASS, 1);
     $existingGroupBefore->setName($groupName);
     $existingGroupAfter = clone $existingGroupBefore;
     $existingGroupAfter->setName($alteredGroupName);
     return ['empty' => ['options' => [], 'defaultData' => null, 'viewData' => null, 'submittedData' => ['name' => $groupName], 'expectedData' => $defaultGroup], 'existing' => ['options' => [], 'defaultData' => $existingGroupBefore, 'viewData' => $existingGroupBefore, 'submittedData' => ['name' => $alteredGroupName], 'expectedData' => $existingGroupAfter]];
 }
 /**
  * @param string $name
  * @return CustomerGroup
  */
 protected function createCustomerGroup($name)
 {
     $customerGroup = new CustomerGroup();
     $customerGroup->setName($name);
     return $customerGroup;
 }