本文整理匯總了PHP中Magento\Catalog\Test\Page\Adminhtml\CatalogProductEdit::getMessagesBlock方法的典型用法代碼示例。如果您正苦於以下問題:PHP CatalogProductEdit::getMessagesBlock方法的具體用法?PHP CatalogProductEdit::getMessagesBlock怎麽用?PHP CatalogProductEdit::getMessagesBlock使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Magento\Catalog\Test\Page\Adminhtml\CatalogProductEdit
的用法示例。
在下文中一共展示了CatalogProductEdit::getMessagesBlock方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: processAssert
/**
* Check whether the attribute is unique.
*
* @param CatalogProductIndex $catalogProductIndex
* @param CatalogProductEdit $catalogProductEdit
* @param CatalogProductAttribute $attribute
* @param CatalogProductSimple $product ,
* @param FixtureFactory $fixtureFactory
* @throws \Exception
* @return void
*/
public function processAssert(CatalogProductIndex $catalogProductIndex, CatalogProductEdit $catalogProductEdit, CatalogProductAttribute $attribute, CatalogProductSimple $product, FixtureFactory $fixtureFactory)
{
$this->fixtureFactory = $fixtureFactory;
$simpleProduct = $this->createSimpleProductFixture($product, $attribute);
$catalogProductIndex->open()->getGridPageActionBlock()->addProduct('simple');
$productForm = $catalogProductEdit->getProductForm();
$productForm->fill($simpleProduct);
$catalogProductEdit->getFormPageActions()->save();
$actualErrorMessage = $catalogProductEdit->getMessagesBlock()->getErrorMessage();
$attributeLabel = $attribute->getFrontendLabel();
\PHPUnit_Framework_Assert::assertEquals(sprintf(self::UNIQUE_MESSAGE, $attributeLabel), $actualErrorMessage, 'JS error notice on product edit page is not equal to expected.');
}
示例2: assignPromotedProducts
/**
* Assign promoted products.
*
* @param string $promotedProducts
* @param string $type
* @return void
*/
protected function assignPromotedProducts($promotedProducts, $type)
{
$promotedProducts = $this->parsePromotedProducts($promotedProducts);
foreach ($promotedProducts as $productName => $assignedNames) {
$initialProduct = $this->products[$productName];
$filter = ['sku' => $initialProduct->getSku()];
$assignedProducts = [];
foreach ($assignedNames as $assignedName) {
$assignedProducts[] = $this->products[$assignedName];
}
$product = $this->fixtureFactory->create(get_class($initialProduct), ['data' => [$type => ['products' => $assignedProducts]]]);
$this->catalogProductIndex->open();
$this->catalogProductIndex->getProductGrid()->searchAndOpen($filter);
$this->catalogProductEdit->getProductForm()->fill($product);
$this->catalogProductEdit->getFormPageActions()->save();
$this->catalogProductEdit->getMessagesBlock()->waitSuccessMessage();
}
}
示例3: processAssert
/**
* Checking the output message successful product duplication
*
* @param CatalogProductEdit $productPage
* @return void
*/
public function processAssert(CatalogProductEdit $productPage)
{
$actualMessages = $productPage->getMessagesBlock()->getSuccessMessages();
\PHPUnit_Framework_Assert::assertContains(self::DUPLICATE_MESSAGE, $actualMessages, 'Wrong duplicated message is displayed.' . "\nExpected: " . self::DUPLICATE_MESSAGE . "\nActual:\n" . implode("\n - ", $actualMessages));
}
示例4: processAssert
/**
* Assert that success message is displayed after product save
*
* @param CatalogProductEdit $productPage
* @return void
*/
public function processAssert(CatalogProductEdit $productPage)
{
$actualMessage = $productPage->getMessagesBlock()->getSuccessMessages();
\PHPUnit_Framework_Assert::assertEquals(self::SUCCESS_MESSAGE, $actualMessage, 'Wrong success message is displayed.' . "\nExpected: " . self::SUCCESS_MESSAGE . "\nActual: " . $actualMessage);
}
示例5: processAssert
/**
* Assert that success message is displayed after product save
*
* @param CatalogProductEdit $productPage
* @return void
*/
public function processAssert(CatalogProductEdit $productPage)
{
$actualMessages = $productPage->getMessagesBlock()->getSuccessMessages();
$actualMessages = is_array($actualMessages) ? $actualMessages : [$actualMessages];
\PHPUnit_Framework_Assert::assertContains(self::SUCCESS_MESSAGE, $actualMessages, 'Wrong success message is displayed.' . "\nExpected: " . self::SUCCESS_MESSAGE . "\nActual:\n" . implode("\n - ", $actualMessages));
}