PHP Class Sylius\Behat\Context\Setup\ProductContext

Author: Arkadiusz Krakowiak ([email protected])
Author: Mateusz Zalewski ([email protected])
Author: Magdalena Banasiak ([email protected])
Inheritance: implements Behat\Behat\Context\Context
Show file Open project: sylius/sylius

Public Methods

Method Description
__construct ( Sylius\Behat\Service\SharedStorageInterface $sharedStorage, Sylius\Component\Core\Repository\ProductRepositoryInterface $productRepository, Sylius\Component\Product\Factory\ProductFactoryInterface $productFactory, Sylius\Component\Resource\Factory\FactoryInterface $productTranslationFactory, Sylius\Component\Attribute\Factory\AttributeFactoryInterface $productAttributeFactory, Sylius\Component\Resource\Factory\FactoryInterface $attributeValueFactory, Sylius\Component\Resource\Factory\FactoryInterface $productVariantFactory, Sylius\Component\Resource\Factory\FactoryInterface $channelPricingFactory, Sylius\Component\Resource\Factory\FactoryInterface $productOptionFactory, Sylius\Component\Resource\Factory\FactoryInterface $productOptionValueFactory, Sylius\Component\Resource\Factory\FactoryInterface $productImageFactory, Doctrine\Common\Persistence\ObjectManager $objectManager, Sylius\Component\Product\Resolver\ProductVariantResolverInterface $defaultVariantResolver, Sylius\Component\Core\Uploader\ImageUploaderInterface $imageUploader, Sylius\Component\Product\Generator\SlugGeneratorInterface $slugGenerator, array $minkParameters )
itComesInTheFollowingVariations ( Sylius\Component\Core\Model\ProductInterface $product, Behat\Gherkin\Node\TableNode $table )
itHasDifferentPricesForDifferentChannelsAndCurrencies ( Sylius\Component\Core\Model\ProductInterface $product )
itHasPriceForChannelAndCurrency ( Sylius\Component\Core\Model\ProductInterface $product, $price, Sylius\Component\Core\Model\ChannelInterface $channel, $currency )
otherCustomerHasBoughtProductsByThisTime ( $quantity, Sylius\Component\Core\Model\ProductInterface $product )
productBelongsToTaxCategory ( Sylius\Component\Core\Model\ProductInterface $product, Sylius\Component\Taxation\Model\TaxCategoryInterface $taxCategory )
productVariantBelongsToTaxCategory ( Sylius\Component\Core\Model\ProductVariantInterface $productVariant, Sylius\Component\Taxation\Model\TaxCategoryInterface $taxCategory )
storeHasAConfigurableProduct ( $productName )
storeHasAProductPricedAt ( $productName, $price = 100, Sylius\Component\Core\Model\ChannelInterface $channel = null )
storeHasAProductPricedAtAvailableInChannels ( $productName, $price = 100, $channels )
storeHasProductWithCode ( $productName, $code, $date = null )
theProductChangedItsPriceTo ( Sylius\Component\Core\Model\ProductInterface $product, $price )
theProductHasVariantPricedAt ( Sylius\Component\Core\Model\ProductInterface $product, $productVariantName, $price, Sylius\Component\Core\Model\ChannelInterface $channel = null )
theProductHasVariantPricedAtIdentifiedBy ( Sylius\Component\Core\Model\ProductInterface $product, $productVariantName, $price, $code )
theProductIsOutOfStock ( Sylius\Component\Core\Model\ProductInterface $product )
theProductVariantIsTrackedByTheInventory ( Sylius\Component\Core\Model\ProductVariantInterface $productVariant )
theStoreHasProductNamedInAndIn ( $firstName, $firstLocale, $secondName, $secondLocale )
theStoreHasProducts ( $productsNames )
thereAreItemsOfProductInVariantAvailableInTheInventory ( $quantity, Sylius\Component\Core\Model\ProductVariantInterface $productVariant )
thereIsProductAvailableInGivenChannel ( $productName, Sylius\Component\Core\Model\ChannelInterface $channel )
thereIsQuantityOfProducts ( $quantity, Sylius\Component\Core\Model\ProductInterface $product )
thisChannelHasProducts ( Sylius\Component\Core\Model\ChannelInterface $channel, $productsNames )
thisProductBelongsToShippingCategory ( Sylius\Component\Core\Model\ProductInterface $product, Sylius\Component\Shipping\Model\ShippingCategoryInterface $shippingCategory )
thisProductHasAnImageWithACode ( Sylius\Component\Core\Model\ProductInterface $product, $imagePath, $imageCode )
thisProductHasAttributeWithValue ( Sylius\Component\Core\Model\ProductInterface $product, $productAttributeType, $productAttributeName, $value )
thisProductHasCheckboxAttributeWithValue ( Sylius\Component\Core\Model\ProductInterface $product, $productAttributeType, $productAttributeName, $value )
thisProductHasDateTimeAttributeWithDate ( Sylius\Component\Core\Model\ProductInterface $product, $productAttributeType, $productAttributeName, $date )
thisProductHasOptionWithValues ( Sylius\Component\Core\Model\ProductInterface $product, $optionName, $values )
thisProductHasPercentAttributeWithValue ( Sylius\Component\Core\Model\ProductInterface $product, $productAttributeName, $value )
thisProductHasPercentAttributeWithValueAtPosition ( Sylius\Component\Core\Model\ProductInterface $product, $productAttributeName, $position )
thisProductHasThisProductOption ( Sylius\Component\Core\Model\ProductInterface $product, Sylius\Component\Product\Model\ProductOptionInterface $option )
thisProductIsAlsoPricedAtInChannel ( Sylius\Component\Core\Model\ProductInterface $product, $price, Sylius\Component\Core\Model\ChannelInterface $channel )
thisProductIsAvailableInSize ( Sylius\Component\Core\Model\ProductInterface $product, $optionValueName, $optionName, $price )
thisProductIsNamedIn ( Sylius\Component\Core\Model\ProductInterface $product, $name, $locale )
thisProductIsTrackedByTheInventory ( Sylius\Component\Core\Model\ProductInterface $product )
thisProductSizeBelongsToShippingCategory ( Sylius\Component\Core\Model\ProductInterface $product, $optionValueName, Sylius\Component\Shipping\Model\ShippingCategoryInterface $shippingCategory )

Private Methods

Method Description
addProductOption ( Sylius\Component\Product\Model\ProductOptionInterface $option, string $value, string $code ) : Sylius\Component\Product\Model\ProductOptionValueInterface
addProductTranslation ( Sylius\Component\Core\Model\ProductInterface $product, string $name, string $locale )
createChannelPricingForChannel ( integer $price, Sylius\Component\Core\Model\ChannelInterface $channel = null ) : Sylius\Component\Core\Model\ChannelPricingInterface
createProduct ( string $productName, integer $price = 100, string | null $date = null, Sylius\Component\Core\Model\ChannelInterface $channel = null ) : Sylius\Component\Core\Model\ProductInterface
createProductAttribute ( string $type, string $name, string | null $code = null ) : Sylius\Component\Product\Model\ProductAttributeInterface
createProductAttributeValue ( string $value, Sylius\Component\Product\Model\ProductAttributeInterface $attribute ) : Sylius\Component\Product\Model\ProductAttributeValueInterface
createProductVariant ( Sylius\Component\Core\Model\ProductInterface $product, $productVariantName, integer $price, string $code, Sylius\Component\Core\Model\ChannelInterface $channel = null )
getParameter ( string $name ) : Behat\Mink\Element\NodeElement
getPriceFromString ( string $price ) : integer
saveProduct ( Sylius\Component\Core\Model\ProductInterface $product )

Method Details

__construct() public method

public __construct ( Sylius\Behat\Service\SharedStorageInterface $sharedStorage, Sylius\Component\Core\Repository\ProductRepositoryInterface $productRepository, Sylius\Component\Product\Factory\ProductFactoryInterface $productFactory, Sylius\Component\Resource\Factory\FactoryInterface $productTranslationFactory, Sylius\Component\Attribute\Factory\AttributeFactoryInterface $productAttributeFactory, Sylius\Component\Resource\Factory\FactoryInterface $attributeValueFactory, Sylius\Component\Resource\Factory\FactoryInterface $productVariantFactory, Sylius\Component\Resource\Factory\FactoryInterface $channelPricingFactory, Sylius\Component\Resource\Factory\FactoryInterface $productOptionFactory, Sylius\Component\Resource\Factory\FactoryInterface $productOptionValueFactory, Sylius\Component\Resource\Factory\FactoryInterface $productImageFactory, Doctrine\Common\Persistence\ObjectManager $objectManager, Sylius\Component\Product\Resolver\ProductVariantResolverInterface $defaultVariantResolver, Sylius\Component\Core\Uploader\ImageUploaderInterface $imageUploader, Sylius\Component\Product\Generator\SlugGeneratorInterface $slugGenerator, array $minkParameters )
$sharedStorage Sylius\Behat\Service\SharedStorageInterface
$productRepository Sylius\Component\Core\Repository\ProductRepositoryInterface
$productFactory Sylius\Component\Product\Factory\ProductFactoryInterface
$productTranslationFactory Sylius\Component\Resource\Factory\FactoryInterface
$productAttributeFactory Sylius\Component\Attribute\Factory\AttributeFactoryInterface
$attributeValueFactory Sylius\Component\Resource\Factory\FactoryInterface
$productVariantFactory Sylius\Component\Resource\Factory\FactoryInterface
$channelPricingFactory Sylius\Component\Resource\Factory\FactoryInterface
$productOptionFactory Sylius\Component\Resource\Factory\FactoryInterface
$productOptionValueFactory Sylius\Component\Resource\Factory\FactoryInterface
$productImageFactory Sylius\Component\Resource\Factory\FactoryInterface
$objectManager Doctrine\Common\Persistence\ObjectManager
$defaultVariantResolver Sylius\Component\Product\Resolver\ProductVariantResolverInterface
$imageUploader Sylius\Component\Core\Uploader\ImageUploaderInterface
$slugGenerator Sylius\Component\Product\Generator\SlugGeneratorInterface
$minkParameters array

itComesInTheFollowingVariations() public method

public itComesInTheFollowingVariations ( Sylius\Component\Core\Model\ProductInterface $product, Behat\Gherkin\Node\TableNode $table )
$product Sylius\Component\Core\Model\ProductInterface
$table Behat\Gherkin\Node\TableNode

itHasDifferentPricesForDifferentChannelsAndCurrencies() public method

public itHasDifferentPricesForDifferentChannelsAndCurrencies ( Sylius\Component\Core\Model\ProductInterface $product )
$product Sylius\Component\Core\Model\ProductInterface

itHasPriceForChannelAndCurrency() public method

public itHasPriceForChannelAndCurrency ( Sylius\Component\Core\Model\ProductInterface $product, $price, Sylius\Component\Core\Model\ChannelInterface $channel, $currency )
$product Sylius\Component\Core\Model\ProductInterface
$channel Sylius\Component\Core\Model\ChannelInterface

otherCustomerHasBoughtProductsByThisTime() public method

public otherCustomerHasBoughtProductsByThisTime ( $quantity, Sylius\Component\Core\Model\ProductInterface $product )
$product Sylius\Component\Core\Model\ProductInterface

productBelongsToTaxCategory() public method

public productBelongsToTaxCategory ( Sylius\Component\Core\Model\ProductInterface $product, Sylius\Component\Taxation\Model\TaxCategoryInterface $taxCategory )
$product Sylius\Component\Core\Model\ProductInterface
$taxCategory Sylius\Component\Taxation\Model\TaxCategoryInterface

productVariantBelongsToTaxCategory() public method

public productVariantBelongsToTaxCategory ( Sylius\Component\Core\Model\ProductVariantInterface $productVariant, Sylius\Component\Taxation\Model\TaxCategoryInterface $taxCategory )
$productVariant Sylius\Component\Core\Model\ProductVariantInterface
$taxCategory Sylius\Component\Taxation\Model\TaxCategoryInterface

storeHasAConfigurableProduct() public method

public storeHasAConfigurableProduct ( $productName )

storeHasAProductPricedAt() public method

public storeHasAProductPricedAt ( $productName, $price = 100, Sylius\Component\Core\Model\ChannelInterface $channel = null )
$channel Sylius\Component\Core\Model\ChannelInterface

storeHasAProductPricedAtAvailableInChannels() public method

public storeHasAProductPricedAtAvailableInChannels ( $productName, $price = 100, $channels )

storeHasProductWithCode() public method

public storeHasProductWithCode ( $productName, $code, $date = null )

theProductChangedItsPriceTo() public method

public theProductChangedItsPriceTo ( Sylius\Component\Core\Model\ProductInterface $product, $price )
$product Sylius\Component\Core\Model\ProductInterface

theProductHasVariantPricedAt() public method

public theProductHasVariantPricedAt ( Sylius\Component\Core\Model\ProductInterface $product, $productVariantName, $price, Sylius\Component\Core\Model\ChannelInterface $channel = null )
$product Sylius\Component\Core\Model\ProductInterface
$channel Sylius\Component\Core\Model\ChannelInterface

theProductHasVariantPricedAtIdentifiedBy() public method

public theProductHasVariantPricedAtIdentifiedBy ( Sylius\Component\Core\Model\ProductInterface $product, $productVariantName, $price, $code )
$product Sylius\Component\Core\Model\ProductInterface

theProductIsOutOfStock() public method

public theProductIsOutOfStock ( Sylius\Component\Core\Model\ProductInterface $product )
$product Sylius\Component\Core\Model\ProductInterface

theProductVariantIsTrackedByTheInventory() public method

public theProductVariantIsTrackedByTheInventory ( Sylius\Component\Core\Model\ProductVariantInterface $productVariant )
$productVariant Sylius\Component\Core\Model\ProductVariantInterface

theStoreHasProductNamedInAndIn() public method

public theStoreHasProductNamedInAndIn ( $firstName, $firstLocale, $secondName, $secondLocale )

theStoreHasProducts() public method

public theStoreHasProducts ( $productsNames )

thereAreItemsOfProductInVariantAvailableInTheInventory() public method

public thereAreItemsOfProductInVariantAvailableInTheInventory ( $quantity, Sylius\Component\Core\Model\ProductVariantInterface $productVariant )
$productVariant Sylius\Component\Core\Model\ProductVariantInterface

thereIsProductAvailableInGivenChannel() public method

public thereIsProductAvailableInGivenChannel ( $productName, Sylius\Component\Core\Model\ChannelInterface $channel )
$channel Sylius\Component\Core\Model\ChannelInterface

thereIsQuantityOfProducts() public method

public thereIsQuantityOfProducts ( $quantity, Sylius\Component\Core\Model\ProductInterface $product )
$product Sylius\Component\Core\Model\ProductInterface

thisChannelHasProducts() public method

public thisChannelHasProducts ( Sylius\Component\Core\Model\ChannelInterface $channel, $productsNames )
$channel Sylius\Component\Core\Model\ChannelInterface

thisProductBelongsToShippingCategory() public method

public thisProductBelongsToShippingCategory ( Sylius\Component\Core\Model\ProductInterface $product, Sylius\Component\Shipping\Model\ShippingCategoryInterface $shippingCategory )
$product Sylius\Component\Core\Model\ProductInterface
$shippingCategory Sylius\Component\Shipping\Model\ShippingCategoryInterface

thisProductHasAnImageWithACode() public method

public thisProductHasAnImageWithACode ( Sylius\Component\Core\Model\ProductInterface $product, $imagePath, $imageCode )
$product Sylius\Component\Core\Model\ProductInterface

thisProductHasAttributeWithValue() public method

public thisProductHasAttributeWithValue ( Sylius\Component\Core\Model\ProductInterface $product, $productAttributeType, $productAttributeName, $value )
$product Sylius\Component\Core\Model\ProductInterface

thisProductHasCheckboxAttributeWithValue() public method

public thisProductHasCheckboxAttributeWithValue ( Sylius\Component\Core\Model\ProductInterface $product, $productAttributeType, $productAttributeName, $value )
$product Sylius\Component\Core\Model\ProductInterface

thisProductHasDateTimeAttributeWithDate() public method

public thisProductHasDateTimeAttributeWithDate ( Sylius\Component\Core\Model\ProductInterface $product, $productAttributeType, $productAttributeName, $date )
$product Sylius\Component\Core\Model\ProductInterface

thisProductHasOptionWithValues() public method

public thisProductHasOptionWithValues ( Sylius\Component\Core\Model\ProductInterface $product, $optionName, $values )
$product Sylius\Component\Core\Model\ProductInterface

thisProductHasPercentAttributeWithValue() public method

public thisProductHasPercentAttributeWithValue ( Sylius\Component\Core\Model\ProductInterface $product, $productAttributeName, $value )
$product Sylius\Component\Core\Model\ProductInterface

thisProductHasPercentAttributeWithValueAtPosition() public method

public thisProductHasPercentAttributeWithValueAtPosition ( Sylius\Component\Core\Model\ProductInterface $product, $productAttributeName, $position )
$product Sylius\Component\Core\Model\ProductInterface

thisProductHasThisProductOption() public method

public thisProductHasThisProductOption ( Sylius\Component\Core\Model\ProductInterface $product, Sylius\Component\Product\Model\ProductOptionInterface $option )
$product Sylius\Component\Core\Model\ProductInterface
$option Sylius\Component\Product\Model\ProductOptionInterface

thisProductIsAlsoPricedAtInChannel() public method

public thisProductIsAlsoPricedAtInChannel ( Sylius\Component\Core\Model\ProductInterface $product, $price, Sylius\Component\Core\Model\ChannelInterface $channel )
$product Sylius\Component\Core\Model\ProductInterface
$channel Sylius\Component\Core\Model\ChannelInterface

thisProductIsAvailableInSize() public method

public thisProductIsAvailableInSize ( Sylius\Component\Core\Model\ProductInterface $product, $optionValueName, $optionName, $price )
$product Sylius\Component\Core\Model\ProductInterface

thisProductIsNamedIn() public method

public thisProductIsNamedIn ( Sylius\Component\Core\Model\ProductInterface $product, $name, $locale )
$product Sylius\Component\Core\Model\ProductInterface

thisProductIsTrackedByTheInventory() public method

public thisProductIsTrackedByTheInventory ( Sylius\Component\Core\Model\ProductInterface $product )
$product Sylius\Component\Core\Model\ProductInterface

thisProductSizeBelongsToShippingCategory() public method

public thisProductSizeBelongsToShippingCategory ( Sylius\Component\Core\Model\ProductInterface $product, $optionValueName, Sylius\Component\Shipping\Model\ShippingCategoryInterface $shippingCategory )
$product Sylius\Component\Core\Model\ProductInterface
$shippingCategory Sylius\Component\Shipping\Model\ShippingCategoryInterface