$browser =
$this->
createClient();
$browser->
request('POST', '/api/_action/customer-group-registration/accept',
[ 'customerIds' =>
[$this->ids->
get('customer'
)],
]);
/** @var CustomerGroupEntity $customerGroup */
$customerGroup =
$this->
getContainer()->
get('customer_group.repository'
) ->
search(new Criteria([$this->ids->
get('customer_group'
)]), Context::
createDefaultContext())->
first();
$expect =
$option === 'clear' ? null :
[$customFieldName =>
$expectData];
static::
assertEquals($customerGroup->
getCustomFields(),
$expect);
} /**
* @return array<string, mixed>
*/
public static function createDataProvider(): array
{ return [ 'upsert / existed data / update data / expect data' =>
['upsert',
['red', 'green'
],
['blue', 'gray'
],
['blue', 'gray'
]],
'create / existed data / update data / expect data' =>
['create',
['red', 'green'
],
['blue', 'gray'
],
['red', 'green'
]],
'clear / existed data / update data / expect data' =>
['clear',
['red', 'green', 'blue'
], null, null
],