本文整理匯總了PHP中Magento\Catalog\Test\Page\Product\CatalogProductView::getTitleBlock方法的典型用法代碼示例。如果您正苦於以下問題:PHP CatalogProductView::getTitleBlock方法的具體用法?PHP CatalogProductView::getTitleBlock怎麽用?PHP CatalogProductView::getTitleBlock使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Magento\Catalog\Test\Page\Product\CatalogProductView
的用法示例。
在下文中一共展示了CatalogProductView::getTitleBlock方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: processAssert
/**
* Check that product available by new URL on the front
*
* @param UrlRewrite $urlRewrite
* @param CatalogProductView $catalogProductView
* @param BrowserInterface $browser
* @param InjectableFixture $product
* @return void
*/
public function processAssert(UrlRewrite $urlRewrite, CatalogProductView $catalogProductView, BrowserInterface $browser, InjectableFixture $product = null)
{
$browser->open($_ENV['app_frontend_url'] . $urlRewrite->getRequestPath());
if ($product === null) {
$product = $urlRewrite->getDataFieldConfig('target_path')['source']->getEntity();
}
\PHPUnit_Framework_Assert::assertEquals($catalogProductView->getTitleBlock()->getTitle(), $product->getName(), 'URL rewrite product redirect false.' . "\nExpected: " . $product->getName() . "\nActual: " . $catalogProductView->getTitleBlock()->getTitle());
}
示例2: isNotDisplayingOnFrontendAssert
/**
* Verify product displaying on frontend
*
* @param FixtureInterface $product
* @return array
*/
protected function isNotDisplayingOnFrontendAssert(FixtureInterface $product)
{
$errors = [];
// Check the product page is not available
// TODO fix initialization url for frontend page
$this->browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html');
$titleBlock = $this->catalogProductView->getTitleBlock();
if ($titleBlock->getTitle() !== self::NOT_FOUND_MESSAGE) {
$errors[] = '- the headline on the page does not match, the text should be -> "' . self::NOT_FOUND_MESSAGE . '".';
}
$this->cmsIndex->open();
$this->cmsIndex->getSearchBlock()->search($product->getSku());
if ($this->catalogSearchResult->getListProductBlock()->isProductVisible($product->getName())) {
$errors[] = '- successful product search.';
}
$categoryName = $product->hasData('category_ids') ? $product->getCategoryIds()[0] : $this->category->getName();
$this->cmsIndex->open();
$this->cmsIndex->getTopmenu()->selectCategoryByName($categoryName);
$isProductVisible = $this->catalogCategoryView->getListProductBlock()->isProductVisible($product->getName());
while (!$isProductVisible && $this->catalogCategoryView->getBottomToolbar()->nextPage()) {
$isProductVisible = $this->catalogCategoryView->getListProductBlock()->isProductVisible($product->getName());
}
if ($isProductVisible) {
$errors[] = "- product with name '{$product->getName()}' is found in this category.";
}
return $errors;
}
示例3: processAssert
/**
* Assert that after click on widget link on frontend system redirects you to Product page defined in widget.
*
* @param CmsIndex $cmsIndex
* @param CatalogProductView $productView
* @param Widget $widget
* @param AdminCache $adminCache
* @return void
*/
public function processAssert(CmsIndex $cmsIndex, CatalogProductView $productView, Widget $widget, AdminCache $adminCache)
{
// Flush cache
$adminCache->open();
$adminCache->getActionsBlock()->flushMagentoCache();
$adminCache->getMessagesBlock()->waitSuccessMessage();
$cmsIndex->open();
$cmsIndex->getTopmenu()->selectCategoryByName($widget->getWidgetInstance()[0]['entities']->getName());
$cmsIndex->getWidgetView()->clickToWidget($widget, $widget->getParameters()['anchor_text']);
$title = $productView->getTitleBlock()->getTitle();
\PHPUnit_Framework_Assert::assertEquals($widget->getParameters()['entities'][0]->getName(), $title, 'Wrong product title.');
}
示例4: processAssert
/**
* Checking the server response 404 page on frontend
*
* @param BrowserInterface $browser
* @param CatalogProductView $catalogProductView
* @param UrlRewrite $productRedirect
* @return void
*/
public function processAssert(BrowserInterface $browser, CatalogProductView $catalogProductView, UrlRewrite $productRedirect)
{
$browser->open($_ENV['app_frontend_url'] . $productRedirect->getRequestPath());
\PHPUnit_Framework_Assert::assertEquals(self::NOT_FOUND_MESSAGE, $catalogProductView->getTitleBlock()->getTitle(), 'Wrong page is displayed.');
}