customer_group.php 626 B

12345678910111213141516
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. /** @var \Magento\Customer\Api\GroupRepositoryInterface $groupRepository */
  7. $groupRepository = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create(
  8. \Magento\Customer\Api\GroupRepositoryInterface::class
  9. );
  10. $groupFactory = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create(
  11. \Magento\Customer\Api\Data\GroupInterfaceFactory::class
  12. );
  13. $groupDataObject = $groupFactory->create();
  14. $groupDataObject->setCode('custom_group')->setTaxClassId(3);
  15. $groupRepository->save($groupDataObject);