new CalculatedCheapestPrice(8, 8,
new CalculatedTaxCollection(),
new TaxRuleCollection()) );
$product->
setCalculatedPrices(new PriceCollection([ new CalculatedPrice(9, 9,
new CalculatedTaxCollection(),
new TaxRuleCollection()),
]));
$context =
$this->
createMock(SalesChannelContext::
class);
$stubs =
$this->
createMock(ScriptPriceStubs::
class);
$proxy =
new ProductProxy($product,
$context,
$stubs);
// @phpstan-ignore-next-line > Access to an undefined property occurs here but the proxy by pass the access to the entity.get() function
static::
assertInstanceOf(PriceFacade::
class,
$proxy->calculatedPrice, 'Proxy should return a facade for the calculated price'
);
// @phpstan-ignore-next-line > Access to an undefined property occurs here but the proxy by pass the access to the entity.get() function
static::
assertInstanceOf(PriceCollectionFacade::
class,
$proxy->calculatedPrices, 'Proxy should return a facade for the calculated prices'
);
// @phpstan-ignore-next-line > Access to an undefined property occurs here but the proxy by pass the access to the entity.get() function
static::
assertInstanceOf(PriceFacade::
class,
$proxy->calculatedCheapestPrice, 'Proxy should return a facade for the calculated cheapest price'
);
// @phpstan-ignore-next-line > Access to an undefined property occurs here but the proxy by pass the access to the entity.get() function
static::
assertEquals('foo',
$proxy->name, 'Proxy should return the same value as the original object'
);
static::
assertArrayHasKey('stock',
$proxy, 'Proxy should be able to check if a property exists'
);
}