1 | <?php |
||
26 | final class ProductContext implements Context |
||
27 | { |
||
28 | /** |
||
29 | * @var SharedStorageInterface |
||
30 | */ |
||
31 | private $sharedStorage; |
||
32 | |||
33 | /** |
||
34 | * @var RepositoryInterface |
||
35 | */ |
||
36 | private $productRepository; |
||
37 | |||
38 | /** |
||
39 | * @var RepositoryInterface |
||
40 | */ |
||
41 | private $taxCategoryRepository; |
||
42 | |||
43 | /** |
||
44 | * @var FactoryInterface |
||
45 | */ |
||
46 | private $productFactory; |
||
47 | |||
48 | /** |
||
49 | * @var ObjectManager |
||
50 | */ |
||
51 | private $productManager; |
||
52 | |||
53 | /** |
||
54 | * @param SharedStorageInterface $sharedStorage |
||
55 | * @param RepositoryInterface $productRepository |
||
56 | * @param RepositoryInterface $taxCategoryRepository |
||
57 | * @param FactoryInterface $productFactory |
||
58 | * @param ObjectManager $productManager |
||
59 | */ |
||
60 | public function __construct( |
||
73 | |||
74 | /** |
||
75 | * @Transform /^product "([^"]+)"$/ |
||
76 | * @Transform /^"([^"]+)" product$/ |
||
77 | * @Transform :product |
||
78 | */ |
||
79 | public function castProductNameToProduct($productName) |
||
88 | |||
89 | /** |
||
90 | * @Given /^store has a product "([^"]+)" priced at "(?:€|£|\$)([^"]+)"$/ |
||
91 | */ |
||
92 | public function storeHasAProductPricedAt($productName, $price) |
||
104 | |||
105 | /** |
||
106 | * @Given /^(product "[^"]+") belongs to ("[^"]+" tax category)$/ |
||
107 | */ |
||
108 | public function productBelongsToTaxCategory(ProductInterface $product, TaxCategoryInterface $taxCategory) |
||
113 | |||
114 | /** |
||
115 | * @param string $price |
||
116 | * |
||
117 | * @return int |
||
118 | */ |
||
119 | private function getPriceFromString($price) |
||
123 | } |
||
124 |