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