本文整理汇总了PHP中Sylius\Component\Core\Model\ProductInterface::getName方法的典型用法代码示例。如果您正苦于以下问题:PHP ProductInterface::getName方法的具体用法?PHP ProductInterface::getName怎么用?PHP ProductInterface::getName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Sylius\Component\Core\Model\ProductInterface
的用法示例。
在下文中一共展示了ProductInterface::getName方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: iShouldBeOnProductDetailedPage
/**
* @Then I should be on :product product detailed page
* @Then I should still be on product :product page
*/
public function iShouldBeOnProductDetailedPage(ProductInterface $product)
{
Assert::true($this->showPage->isOpen(['slug' => $product->getSlug()]), sprintf('Product %s show page should be open, but it does not.', $product->getName()));
}
示例2: getProductRowElement
/**
* @param ProductInterface $product
*
* @return NodeElement
*/
private function getProductRowElement(ProductInterface $product)
{
return $this->getElement('product_row', ['%name%' => $product->getName()]);
}
示例3: thisProductShouldNoLongerHavePriceForChannel
/**
* @Then /^(this product) should no longer have price for channel "([^"]+)"$/
*/
public function thisProductShouldNoLongerHavePriceForChannel(ProductInterface $product, $channelName)
{
$this->updateSimpleProductPage->open(['id' => $product->getId()]);
try {
$this->updateSimpleProductPage->getPriceForChannel($channelName);
} catch (ElementNotFoundException $exception) {
return;
}
throw new \Exception(sprintf('Product "%s" should not have price defined for channel "%s".', $product->getName(), $channelName));
}
示例4: productShouldNotHaveAttribute
/**
* @Then /^(product "[^"]+") should not have a "([^"]+)" attribute$/
*/
public function productShouldNotHaveAttribute(ProductInterface $product, $attribute)
{
$this->updateSimpleProductPage->open(['id' => $product->getId()]);
Assert::false($this->updateSimpleProductPage->hasAttribute($attribute), sprintf('Product "%s" should not have attribute "%s" but it does.', $product->getName(), $attribute));
}
示例5: hasProductOutOfStockValidationMessage
/**
* {@inheritdoc]
*/
public function hasProductOutOfStockValidationMessage(ProductInterface $product)
{
$message = sprintf('%s does not have sufficient stock.', $product->getName());
try {
return $this->getElement('validation_errors')->getText() === $message;
} catch (ElementNotFoundException $exception) {
return false;
}
}
示例6: thereAreNoProductReviews
/**
* @Then /^there should be no reviews of (this product)$/
*/
public function thereAreNoProductReviews(ProductInterface $product)
{
$this->productReviewIndexPage->open();
Assert::false($this->productReviewIndexPage->isSingleResourceOnPage(['reviewSubject' => $product->getName()]), sprintf('There should be no reviews of %s.', $product->getName()));
}
示例7: productPriceShouldNotBeDecreased
/**
* @Given /^(product "[^"]+") price should not be decreased$/
*/
public function productPriceShouldNotBeDecreased(ProductInterface $product)
{
$this->cartSummaryPage->open();
expect($this->cartSummaryPage->isItemDiscounted($product->getName()))->toBe(false);
}
示例8: FailureException
function it_throws_exception_if_discount_price_is_present_on_the_page_but_should_not(CartSummaryPageInterface $cartSummaryPage, ProductInterface $product)
{
$cartSummaryPage->open()->shouldBeCalled();
$product->getName()->willReturn('Test product');
$cartSummaryPage->isItemDiscounted('Test product')->willReturn(true);
$this->shouldThrow(new FailureException('Expected <value>false</value>, but got <value>true</value>.'))->during('productPriceShouldNotBeDecreased', [$product]);
}
示例9: thisProductIsAvailableInSize
/**
* @Given /^(this product) is available in "([^"]+)" ([^"]+) priced at ("[^"]+")$/
*/
public function thisProductIsAvailableInSize(ProductInterface $product, $optionValueName, $optionName, $price)
{
/** @var ProductVariantInterface $variant */
$variant = $this->productVariantFactory->createNew();
$optionValue = $this->sharedStorage->get(sprintf('%s_option_%s_value', $optionValueName, $optionName));
$variant->addOptionValue($optionValue);
$variant->addChannelPricing($this->createChannelPricingForChannel($price, $this->sharedStorage->get('channel')));
$variant->setCode(sprintf("%s_%s", $product->getCode(), $optionValueName));
$variant->setName($product->getName());
$product->addVariant($variant);
$this->objectManager->flush();
}