'order_delivery:create',
'order_line_item:create',
'order_transaction:create',
'order_delivery_position:create',
'mail_template_type:update',
'customer:update',
];
foreach ([true, false
] as $testOrderOnly) { TestUser::
createNewTestUser( $browser->
getContainer()->
get(Connection::
class),
$testOrderOnly ?
$orderPrivileges :
['api_proxy_switch-customer', CreditOrderLineItemListener::ACL_ORDER_CREATE_DISCOUNT_PRIVILEGE
],
)->
authorizeBrowser($browser);
$browser->
request('POST',
$this->
getCreateOrderApiUrl($salesChannelContext->
getSalesChannel()->
getId()));
$response =
$browser->
getResponse()->
getContent();
$response =
json_decode($response ?: '', true, 512, \JSON_THROW_ON_ERROR
);
static::
assertArrayHasKey('errors',
$response,
print_r($response, true
));
static::
assertEquals('FRAMEWORK__MISSING_PRIVILEGE_ERROR',
$response['errors'
][0
]['code'
] ?? null
);
static::
assertStringContainsString( $testOrderOnly ? CreditOrderLineItemListener::ACL_ORDER_CREATE_DISCOUNT_PRIVILEGE : 'order_line_item:create',
$response['errors'
][0
]['detail'
] ?? ''
);
}