1 | <?php |
||
29 | final class ProductContext implements Context |
||
30 | { |
||
31 | /** |
||
32 | * @var SharedStorageInterface |
||
33 | */ |
||
34 | private $sharedStorage; |
||
35 | |||
36 | /** |
||
37 | * @var RepositoryInterface |
||
38 | */ |
||
39 | private $productRepository; |
||
40 | |||
41 | /** |
||
42 | * @var FactoryInterface |
||
43 | */ |
||
44 | private $productFactory; |
||
45 | |||
46 | /** |
||
47 | * @var FactoryInterface |
||
48 | */ |
||
49 | private $productVariantFactory; |
||
50 | |||
51 | /** |
||
52 | * @var ObjectManager |
||
53 | */ |
||
54 | private $objectManager; |
||
55 | |||
56 | /** |
||
57 | * @param SharedStorageInterface $sharedStorage |
||
58 | * @param RepositoryInterface $productRepository |
||
59 | * @param FactoryInterface $productFactory |
||
60 | * @param FactoryInterface $productVariantFactory |
||
61 | * @param ObjectManager $objectManager |
||
62 | */ |
||
63 | public function __construct( |
||
76 | |||
77 | /** |
||
78 | * @Given /^the store has a product "([^"]+)"$/ |
||
79 | * @Given /^the store has a product "([^"]+)" priced at ("[^"]+")$/ |
||
80 | */ |
||
81 | public function storeHasAProductPricedAt($productName, $price = 0) |
||
95 | |||
96 | /** |
||
97 | * @Given /^there is product "([^"]+)" available in ((?:this|that|"[^"]+") channel)$/ |
||
98 | */ |
||
99 | public function thereIsProductAvailableInGivenChannel($productName, ChannelInterface $channel) |
||
110 | |||
111 | /** |
||
112 | * @Given /^([^"]+) belongs to ("[^"]+" tax category)$/ |
||
113 | */ |
||
114 | public function productBelongsToTaxCategory(ProductInterface $product, TaxCategoryInterface $taxCategory) |
||
119 | |||
120 | /** |
||
121 | * @Given /^(it) comes in the following variations:$/ |
||
122 | */ |
||
123 | public function itComesInTheFollowingVariations(ProductInterface $product, TableNode $table) |
||
136 | |||
137 | /** |
||
138 | * @Given /^("[^"]+" variant of product "[^"]+") belongs to ("[^"]+" tax category)$/ |
||
139 | */ |
||
140 | public function productVariantBelongsToTaxCategory(ProductVariantInterface $productVariant, TaxCategoryInterface $taxCategory) |
||
145 | |||
146 | /** |
||
147 | * @param string $price |
||
148 | * |
||
149 | * @return int |
||
150 | */ |
||
151 | private function getPriceFromString($price) |
||
155 | } |
||
156 |