1 | <?php |
||
27 | class FeatureContext implements Context |
||
28 | { |
||
29 | /** |
||
30 | * @var FixtureService |
||
31 | */ |
||
32 | private $fixtureService; |
||
33 | |||
34 | private $whitelistedInstitutions = []; |
||
35 | |||
36 | /** |
||
37 | * @var MinkContext |
||
38 | */ |
||
39 | private $minkContext; |
||
40 | |||
41 | /** |
||
42 | * @var array |
||
43 | */ |
||
44 | private $currentToken; |
||
45 | |||
46 | public function __construct(FixtureService $fixtureService) |
||
50 | |||
51 | /** |
||
52 | * @BeforeFeature |
||
53 | */ |
||
54 | public static function setupDatabase(BeforeFeatureScope $scope) |
||
61 | |||
62 | /** |
||
63 | * @BeforeScenario |
||
64 | */ |
||
65 | public function gatherContexts(BeforeScenarioScope $scope) |
||
70 | |||
71 | /** |
||
72 | * @Given /^a user from "([^"]*)" identified by "([^"]*)" with a vetted "([^"]*)" token$/ |
||
73 | */ |
||
74 | public function aUserIdentifiedByWithAVettedToken($institution, $nameId, $tokenType) |
||
75 | { |
||
76 | switch (strtolower($tokenType)) { |
||
77 | case "yubikey": |
||
78 | $this->currentToken = $this->fixtureService->registerYubikeyToken($nameId, $institution); |
||
79 | break; |
||
80 | case "sms": |
||
81 | $this->currentToken = $this->fixtureService->registerSmsToken($nameId, $institution); |
||
82 | break; |
||
83 | case "tiqr": |
||
84 | $this->currentToken = $this->fixtureService->registerTiqrToken($nameId, $institution); |
||
85 | break; |
||
86 | } |
||
87 | } |
||
88 | |||
89 | /** |
||
90 | * @Then I should see the Yubikey OTP screen |
||
91 | */ |
||
92 | public function iShouldSeeTheYubikeyOtpScreen() |
||
93 | { |
||
94 | $this->minkContext->assertPageContainsText('Log in with YubiKey'); |
||
95 | $this->minkContext->assertPageContainsText('Your YubiKey-code'); |
||
96 | } |
||
97 | |||
98 | /** |
||
99 | * @Then I should see the SMS verification screen |
||
100 | */ |
||
101 | public function iShouldSeeTheSMSScreen() |
||
109 | |||
110 | /** |
||
111 | * @Given /^I should see the Tiqr authentication screen$/ |
||
112 | */ |
||
113 | public function iShouldSeeTheTiqrAuthenticationScreen() |
||
119 | |||
120 | /** |
||
121 | * @When I enter the OTP |
||
122 | */ |
||
123 | public function iEnterTheOtp() |
||
129 | |||
130 | /** |
||
131 | * @When I enter the SMS verification code |
||
132 | */ |
||
133 | public function iEnterTheSmsVerificationCode() |
||
139 | |||
140 | |||
141 | /** |
||
142 | * @When I finish the Tiqr authentication |
||
143 | */ |
||
144 | public function iFinishGsspAuthentication() |
||
150 | |||
151 | |||
152 | |||
153 | /** |
||
154 | * @Given /^a whitelisted institution ([^"]*)$/ |
||
155 | */ |
||
156 | public function aWhitelistedInstitution($institution) |
||
160 | |||
161 | /** |
||
162 | * @Then /^I select my ([^"]*) token on the WAYG$/ |
||
163 | */ |
||
164 | public function iShouldSelectMyTokenOnTheWAYG($tokenType) |
||
178 | |||
179 | /** |
||
180 | * @Then /^I should be on the WAYG$/ |
||
181 | */ |
||
182 | public function iShouldBeOnTheWAYG() |
||
186 | |||
187 | /** |
||
188 | * @Then /^an error response is posted back to the SP$/ |
||
189 | */ |
||
190 | public function anErrorResponseIsPostedBackToTheSP() |
||
194 | |||
195 | /** |
||
196 | * @Given /^I cancel the authentication$/ |
||
197 | */ |
||
198 | public function iCancelTheAuthentication() |
||
202 | } |
||
203 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.