$container->
register(DefinitionInstanceRegistry::
class, DefinitionInstanceRegistry::
class) ->
addArgument(new Reference('service_container'
)) ->
addArgument([ CustomerDefinition::ENTITY_NAME => CustomerDefinition::
class,
CustomerAddressDefinition::ENTITY_NAME => CustomerAddressDefinition::
class,
]) ->
addArgument([ CustomerDefinition::ENTITY_NAME => 'customer.repository',
CustomerAddressDefinition::ENTITY_NAME => 'customer_address.repository',
]);
$entityCompilerPass =
new EntityCompilerPass();
$entityCompilerPass->
process($container);
static::
assertNotNull($container->
getAlias('Shopware\Core\Framework\DataAbstractionLayer\EntityRepository $customerRepository'
));
static::
assertNotNull($container->
getAlias('Shopware\Core\Framework\DataAbstractionLayer\EntityRepository $customerAddressRepository'
));
} public function testEntityRepositoryAutowiringForAlreadyDefinedRepositories(): void
{ $container =
new ContainerBuilder();
$container