/** * @param bool $isSecure * @param string $actionUrl * @param int $productId * @dataProvider getProductReviewUrlDataProvider */ public function testGetProductReviewUrl($isSecure, $actionUrl, $productId) { $this->urlBuilder->expects($this->any())->method('getUrl')->with('review/product/listAjax', ['_secure' => $isSecure, 'id' => $productId])->willReturn($actionUrl . '/id/' . $productId); $this->product->expects($this->any())->method('getId')->willReturn($productId); $this->requestMock->expects($this->any())->method('isSecure')->willReturn($isSecure); $this->assertEquals($actionUrl . '/id/' . $productId, $this->block->getProductReviewUrl()); }
protected function _prepareLayout() { $layout = $this->getLayout(); $reviewForm = $layout->createBlock('Magento\\Review\\Block\\Form', 'product.review.form', ['data' => ['jsLayout' => ['components' => ['review-form' => ['component' => 'Magento_Review/js/view/review']]]]]); if ($reviewForm) { $this->setChild('review_form', $reviewForm); $layout->addContainer('product.review.form.fields.before', 'Review Form Fields Before'); $layout->setChild('product.review.form', 'product.review.form.fields.before', 'form_fields_before'); } return parent::_prepareLayout(); }