當前位置: 首頁>>代碼示例>>PHP>>正文


PHP ProductInterface::getName方法代碼示例

本文整理匯總了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()));
 }
開發者ID:sylius,項目名稱:sylius,代碼行數:8,代碼來源:ProductContext.php

示例2: getProductRowElement

 /**
  * @param ProductInterface $product
  *
  * @return NodeElement
  */
 private function getProductRowElement(ProductInterface $product)
 {
     return $this->getElement('product_row', ['%name%' => $product->getName()]);
 }
開發者ID:ReissClothing,項目名稱:Sylius,代碼行數:9,代碼來源:CompletePage.php

示例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));
 }
開發者ID:sylius,項目名稱:sylius,代碼行數:13,代碼來源:ManagingProductsContext.php

示例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));
 }
開發者ID:TheMadeleine,項目名稱:Sylius,代碼行數:8,代碼來源:ManagingProductsContext.php

示例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;
     }
 }
開發者ID:origammi,項目名稱:Sylius,代碼行數:12,代碼來源:SummaryPage.php

示例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()));
 }
開發者ID:loic425,項目名稱:Sylius,代碼行數:8,代碼來源:ManagingProductsContext.php

示例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);
 }
開發者ID:rpg600,項目名稱:Sylius,代碼行數:8,代碼來源:CartContext.php

示例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]);
 }
開發者ID:ahmadrabie,項目名稱:Sylius,代碼行數:7,代碼來源:CartContextSpec.php

示例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();
 }
開發者ID:NeverResponse,項目名稱:Sylius,代碼行數:15,代碼來源:ProductContext.php


注:本文中的Sylius\Component\Core\Model\ProductInterface::getName方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。