foreach ($registry->
getDefinitions() as $definition) { $entity =
$definition->
getEntityName();
foreach ($definition->
getFields() as $field) { /** @var ApiAware|null $flag */
$flag =
$field->
getFlag(ApiAware::
class);
if ($flag === null
) { continue;
} if ($flag->
isSourceAllowed(SalesChannelApiSource::
class)) { $mapping[] =
$entity . '.' .
$field->
getPropertyName();
} } } // file_put_contents(__DIR__ . '/fixtures/api-aware-fields.json', json_encode($mapping, JSON_PRETTY_PRINT));
// To update the mapping you can simply comment the following line and run the test once. The mapping will then be updated.
// The line to update the mapping must of course be commented out again afterwards.
$expected =
file_get_contents(__DIR__ . '/fixtures/api-aware-fields.json'
);
if (!\
is_string($expected)) {