class ProductPageLoaderTest extends TestCase
{ public function testItLoadsReviews(): void
{ $productId = Uuid::
randomHex();
$request =
new Request([],
[],
['productId' =>
$productId]);
$salesChannelContext =
$this->
getSalesChannelContext();
$reviews =
$this->
getCmsSlotConfig();
$productPageLoader =
$this->
getProductPageLoaderWithProduct($productId,
$reviews,
$request,
$salesChannelContext);
$page =
$productPageLoader->
load($request,
$salesChannelContext);
/** @phpstan-ignore-next-line $slot */
$slot =
$page->
getCmsPage()->
getSections()->
first()->
getBlocks()->
first()->
getSlots()->
first()->
getSlot();
static::
assertEquals($reviews,
json_decode((string) $slot, true, 512, \JSON_THROW_ON_ERROR
));
}