本文整理汇总了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));
}