1 | <?php |
||
26 | 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 | */ |
||
78 | public function castProductNameToProduct($productName) |
||
87 | |||
88 | /** |
||
89 | * @Given /^store has a product "([^"]+)" priced at "(?:€|£|\$)([^"]+)"$/ |
||
90 | */ |
||
91 | public function storeHasAProductPricedAt($productName, $price) |
||
103 | |||
104 | /** |
||
105 | * @Given /^(product "[^"]+") belongs to ("[^"]+" tax category)$/ |
||
106 | */ |
||
107 | public function productBelongsToTaxCategory(ProductInterface $product, TaxCategoryInterface $taxCategory) |
||
112 | } |
||
113 |