1 | <?php |
||
24 | final class LocaleContext implements Context |
||
25 | { |
||
26 | /** |
||
27 | * @var UpdatePageInterface |
||
28 | */ |
||
29 | private $adminUpdatePage; |
||
30 | |||
31 | /** |
||
32 | * @var DashboardPageInterface |
||
33 | */ |
||
34 | private $dashboardPage; |
||
35 | |||
36 | /** |
||
37 | * @var TranslatorInterface |
||
38 | */ |
||
39 | private $translator; |
||
40 | |||
41 | /** |
||
42 | * @param UpdatePageInterface $adminUpdatePage |
||
43 | * @param DashboardPageInterface $dashboardPage |
||
44 | * @param TranslatorInterface $translator |
||
45 | */ |
||
46 | public function __construct( |
||
55 | |||
56 | /** |
||
57 | * @Then I should be viewing the administration panel in :localeCode |
||
58 | * @Then I should still be viewing the administration panel in :localeCode |
||
59 | * @Then they should be viewing the administration panel in :localeCode |
||
60 | */ |
||
61 | public function iShouldBeViewingTheAdministrationPanelIn($localeCode) |
||
62 | { |
||
63 | $this->dashboardPage->open(); |
||
64 | |||
65 | $expectedSubHeader = $this->translate('sylius.ui.overview_of_your_store', $localeCode); |
||
66 | $actualSubHeader = $this->dashboardPage->getSubHeader(); |
||
67 | |||
68 | Assert::same( |
||
69 | $actualSubHeader, |
||
70 | $expectedSubHeader, |
||
71 | sprintf('Dashboard header should say "%s", but says "%s" instead.', $expectedSubHeader, $actualSubHeader) |
||
72 | ); |
||
73 | } |
||
74 | |||
75 | /** |
||
76 | * @param string $text |
||
77 | * @param string $localeCode |
||
78 | * |
||
79 | * @return string |
||
80 | */ |
||
81 | private function translate($text, $localeCode) |
||
87 | } |
||
88 |