$proxies =
[ $ids->
get('p1'
) =>
new ProductProxy($p1,
$salesChannelContext,
$stubs),
$ids->
get('p2'
) =>
new ProductProxy($p2,
$salesChannelContext,
$stubs),
$ids->
get('p3.1'
) =>
new ProductProxy($p3,
$salesChannelContext,
$stubs),
];
$salesChannelContext->
considerInheritance();
$hook =
new ProductPricingHookExtension($proxies,
$salesChannelContext,
$ids);
// allows easy debugging
$traces =
new ScriptTraces();
$loader =
$this->
createMock(ScriptLoader::
class);
$loader->
method('get'
)->
willReturn([ new Script('foo',
(string) \
file_get_contents(__DIR__ . '/_fixtures/pricing-cases/product-pricing.twig'
),
new \
DateTimeImmutable()),
]);
$executor =
new ScriptExecutor($loader,
new NullLogger(),
$traces,
$this->
getContainer(),
$this->
getContainer()->
get('twig.extension.trans'
), 'v6.5.0.0'
);
$executor->
execute($hook);
static::
assertNotEmpty($traces->
getTraces());