本文整理匯總了PHP中Magento\Catalog\Test\Page\Product\CatalogProductView::getCustomerReviewBlock方法的典型用法代碼示例。如果您正苦於以下問題:PHP CatalogProductView::getCustomerReviewBlock方法的具體用法?PHP CatalogProductView::getCustomerReviewBlock怎麽用?PHP CatalogProductView::getCustomerReviewBlock使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Magento\Catalog\Test\Page\Product\CatalogProductView
的用法示例。
在下文中一共展示了CatalogProductView::getCustomerReviewBlock方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: processAssert
/**
* Assert that product review Not available on product page
*
* @param CatalogProductView $catalogProductView
* @param ReviewInjectable $reviewInitial
* @param Browser $browser
* @return void
*/
public function processAssert(CatalogProductView $catalogProductView, ReviewInjectable $reviewInitial, Browser $browser)
{
/** @var CatalogProductSimple $product */
$product = $reviewInitial->getDataFieldConfig('entity_id')['source']->getEntity();
$browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html');
$reviewBlock = $catalogProductView->getCustomerReviewBlock();
$catalogProductView->getViewBlock()->selectTab('Reviews');
\PHPUnit_Framework_Assert::assertFalse($reviewBlock->isVisibleReviewItem(), 'Error, product review is displayed.');
}
示例2: processAssert
/**
* Assert that product review available on product page
*
* @param CatalogProductView $catalogProductView
* @param ReviewInjectable $review
* @param FixtureInterface $product
* @param Browser $browser
* @param AdminCache $cachePage
* @return void
*/
public function processAssert(CatalogProductView $catalogProductView, ReviewInjectable $review, FixtureInterface $product, Browser $browser, AdminCache $cachePage)
{
$errors = [];
$cachePage->open()->getActionsBlock()->flushMagentoCache();
$browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html');
$reviewBlock = $catalogProductView->getCustomerReviewBlock();
$catalogProductView->getViewBlock()->selectTab('Reviews');
foreach ($review->getData() as $name => $value) {
$reviewValue = $reviewBlock->getFieldValue($name);
if ($reviewValue !== null && 0 !== strcasecmp($value, trim($reviewValue))) {
$errors[] = '- field "' . $name . '" is not equals submitted one, error value "' . $value . '"';
}
}
\PHPUnit_Framework_Assert::assertEmpty($errors, 'The Review contains the following errors:' . PHP_EOL . implode(PHP_EOL, $errors));
}
示例3: processAssert
/**
* Assert that product review available on product page
*
* @param CatalogProductView $catalogProductView
* @param ReviewInjectable $review
* @param ReviewInjectable $reviewInitial
* @param Browser $browser
* @return void
*/
public function processAssert(CatalogProductView $catalogProductView, ReviewInjectable $review, ReviewInjectable $reviewInitial, Browser $browser)
{
$errors = [];
/** @var CatalogProductSimple $product */
$product = $reviewInitial->getDataFieldConfig('entity_id')['source']->getEntity();
$browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html');
$reviewBlock = $catalogProductView->getCustomerReviewBlock();
$catalogProductView->getViewBlock()->selectTab('Reviews');
foreach ($review->getData() as $name => $value) {
$reviewValue = $reviewBlock->getFieldValue($name);
if ($reviewValue !== null && 0 !== strcasecmp($value, trim($reviewValue))) {
$errors[] = '- field "' . $name . '" is not equals submitted one, error value "' . $value . '"';
}
}
\PHPUnit_Framework_Assert::assertEmpty($errors, 'The Review contains the following errors:' . PHP_EOL . implode(PHP_EOL, $errors));
}
示例4: processAssert
/**
* Assert that product doesn't have a review on product page.
*
* @param CatalogProductView $catalogProductView
* @return void
*/
public function processAssert(CatalogProductView $catalogProductView)
{
$catalogProductView->getViewBlock()->selectTab('Reviews');
\PHPUnit_Framework_Assert::assertFalse($catalogProductView->getCustomerReviewBlock()->isVisibleReviewItem(), 'No reviews below the form required.');
\PHPUnit_Framework_Assert::assertEquals(self::NO_REVIEW_LINK_TEXT, trim($catalogProductView->getReviewSummary()->getAddReviewLink()->getText()), sprintf('"%s" link is not available', self::NO_REVIEW_LINK_TEXT));
}