1 | <?php |
||
27 | final class ShippingContext implements Context |
||
28 | { |
||
29 | /** |
||
30 | * @var RepositoryInterface |
||
31 | */ |
||
32 | private $shippingMethodRepository; |
||
33 | |||
34 | /** |
||
35 | * @var FactoryInterface |
||
36 | */ |
||
37 | private $shippingMethodFactory; |
||
38 | |||
39 | /** |
||
40 | * @var ObjectManager |
||
41 | */ |
||
42 | private $shippingMethodManager; |
||
43 | |||
44 | /** |
||
45 | * @var SharedStorageInterface |
||
46 | */ |
||
47 | private $sharedStorage; |
||
48 | |||
49 | /** |
||
50 | * @param RepositoryInterface $shippingMethodRepository |
||
51 | * @param FactoryInterface $shippingMethodFactory |
||
52 | * @param ObjectManager $shippingMethodManager |
||
53 | * @param SharedStorageInterface $sharedStorage |
||
54 | */ |
||
55 | public function __construct( |
||
66 | |||
67 | /** |
||
68 | * @Transform :shippingMethodName shipping method |
||
69 | * @Transform shipping method :shippingMethodName |
||
70 | */ |
||
71 | public function getShippingMethodByName($shippingMethodName) |
||
80 | |||
81 | /** |
||
82 | * @Given store ships everything for free |
||
83 | * @Given store ships everything for free within :zone zone |
||
84 | */ |
||
85 | public function storeShipsEverythingForFree(ZoneInterface $zone = null) |
||
89 | |||
90 | /** |
||
91 | * @Given /^store has "([^"]*)" shipping method with "(?:€|£|\$)([^"]*)" fee$/ |
||
92 | * @Given /^store has "([^"]*)" shipping method with "(?:€|£|\$)([^"]*)" fee within ("([^"]*)" zone)$/ |
||
93 | * @Given /^store has "([^"]*)" shipping method with "(?:€|£|\$)([^"]*)" fee for (the rest of the world)$/ |
||
94 | */ |
||
95 | public function storeHasShippingMethodWithFee($shippingMethodName, $fee, ZoneInterface $zone = null) |
||
99 | |||
100 | /** |
||
101 | * @Given /^(shipping method "[^"]+") belongs to ("[^"]+" tax category)$/ |
||
102 | */ |
||
103 | public function shippingMethodBelongsToTaxCategory(ShippingMethodInterface $shippingMethod, TaxCategoryInterface $taxCategory) |
||
108 | |||
109 | /** |
||
110 | * @param string $name |
||
111 | * @param string $locale |
||
112 | * @param array $configuration |
||
113 | * @param string $calculator |
||
114 | * @param ZoneInterface|null $zone |
||
115 | */ |
||
116 | private function createShippingMethod( |
||
137 | |||
138 | /** |
||
139 | * @param string $shippingMethodName |
||
140 | * |
||
141 | * @return string |
||
142 | */ |
||
143 | private function getCodeFromName($shippingMethodName) |
||
147 | |||
148 | /** |
||
149 | * @param string $shippingMethodFee |
||
150 | * |
||
151 | * @return string |
||
152 | */ |
||
153 | private function getFeeFromString($shippingMethodFee) |
||
157 | } |
||
158 |