1 | <?php |
||
27 | final class LocaleContext implements Context |
||
28 | { |
||
29 | /** |
||
30 | * @var SharedStorageInterface |
||
31 | */ |
||
32 | private $sharedStorage; |
||
33 | |||
34 | /** |
||
35 | * @var FactoryInterface |
||
36 | */ |
||
37 | private $localeFactory; |
||
38 | |||
39 | /** |
||
40 | * @var RepositoryInterface |
||
41 | */ |
||
42 | private $localeRepository; |
||
43 | |||
44 | /** |
||
45 | * @var ObjectManager |
||
46 | */ |
||
47 | private $localeManager; |
||
48 | |||
49 | /** |
||
50 | * @var ObjectManager |
||
51 | */ |
||
52 | private $channelManager; |
||
53 | |||
54 | /** |
||
55 | * @var LocaleConverterInterface |
||
56 | */ |
||
57 | private $localeConverter; |
||
58 | |||
59 | /** |
||
60 | * @param SharedStorageInterface $sharedStorage |
||
61 | * @param LocaleConverterInterface $localeConverter |
||
62 | * @param FactoryInterface $localeFactory |
||
63 | * @param RepositoryInterface $localeRepository |
||
64 | * @param ObjectManager $localeManager |
||
65 | * @param ObjectManager $channelManager |
||
66 | */ |
||
67 | public function __construct( |
||
82 | |||
83 | /** |
||
84 | * @Given the store has locale :localeCode |
||
85 | * @Given the store is( also) available in :localeCode |
||
86 | * @Given the locale :localeCode is enabled |
||
87 | */ |
||
88 | public function theStoreHasLocale($localeCode) |
||
94 | |||
95 | /** |
||
96 | * @Given the store has disabled locale :localeCode |
||
97 | * @Given the locale :localeCode is disabled (as well) |
||
98 | * @Given the locale :localeCode gets disabled |
||
99 | * @Given language :localeCode is disabled |
||
100 | */ |
||
101 | public function theStoreHasDisabledLocale($localeCode) |
||
108 | |||
109 | /** |
||
110 | * @Given the locale :localeCode does not exist in the store |
||
111 | */ |
||
112 | public function theStoreDoesNotHaveLocale($localeCode) |
||
120 | |||
121 | /** |
||
122 | * @Given /^(that channel) allows to shop using the "([^"]+)" locale$/ |
||
123 | * @Given /^(that channel) allows to shop using "([^"]+)" and "([^"]+)" locales$/ |
||
124 | * @Given /^(that channel) allows to shop using "([^"]+)", "([^"]+)" and "([^"]+)" locales$/ |
||
125 | */ |
||
126 | public function thatChannelAllowsToShopUsingAndLocales(ChannelInterface $channel, ...$localesNames) |
||
138 | |||
139 | /** |
||
140 | * @Given /^(it) uses the "([^"]+)" locale by default$/ |
||
141 | */ |
||
142 | public function itUsesTheLocaleByDefault(ChannelInterface $channel, $localeName) |
||
153 | |||
154 | /** |
||
155 | * @param string $localeCode |
||
156 | * |
||
157 | * @return LocaleInterface |
||
158 | */ |
||
159 | private function createLocale($localeCode) |
||
167 | |||
168 | /** |
||
169 | * @param string $localeCode |
||
170 | * |
||
171 | * @return LocaleInterface |
||
172 | */ |
||
173 | private function provideLocale($localeCode) |
||
185 | |||
186 | /** |
||
187 | * @param LocaleInterface $locale |
||
188 | */ |
||
189 | private function saveLocale(LocaleInterface $locale) |
||
194 | } |
||
195 |