저자: Łukasz Chruściel (lukasz.chrusciel@lakion.com)
상속: extends Sylius\Behat\Page\Admin\Crud\UpdatePageInterface
예제 #1
0
 /**
  * @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));
 }
 /**
  * @Then I should be notified that the image with this code already exists
  */
 public function iShouldBeNotifiedThatTheImageWithThisCodeAlreadyExists()
 {
     Assert::same($this->updateSimpleProductPage->getValidationMessageForImage('code'), 'Image code must be unique within this product.');
 }
 /**
  * @Then I should be notified that the :imageNumber image should have an unique code
  */
 public function iShouldBeNotifiedThatTheFirstImageShouldHaveAnUniqueCode($imageNumber)
 {
     Assert::same($this->updateSimpleProductPage->getValidationMessageForImageAtPosition((int) $imageNumber - 1), 'Image code must be unique within this product.');
 }
예제 #4
0
 /**
  * @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));
 }
 /**
  * @Then /^inventory of (this product) should be tracked$/
  */
 public function thisProductShouldBeTracked(ProductInterface $product)
 {
     $this->iWantToModifyAProduct($product);
     Assert::true($this->updateSimpleProductPage->isTracked(), '"%s" should be tracked, but it is not.');
 }