@@ 22-37 (lines=16) @@ | ||
19 | /** |
|
20 | * @Given /^there are following users:$/ |
|
21 | */ |
|
22 | public function thereAreFollowingUsers(TableNode $table) |
|
23 | { |
|
24 | foreach ($table->getHash() as $data) { |
|
25 | $this->thereIsUser( |
|
26 | $data['username'], |
|
27 | $data['email'], |
|
28 | $data['password'], |
|
29 | isset($data['role']) ? $data['role'] : 'ROLE_USER', |
|
30 | isset($data['enabled']) ? $data['enabled'] : true, |
|
31 | isset($data['group']) && !empty($data['group']) ? $data['group'] : null, |
|
32 | false |
|
33 | ); |
|
34 | } |
|
35 | ||
36 | $this->getEntityManager()->flush(); |
|
37 | } |
|
38 | ||
39 | public function thereIsUser($username, $email, $password, $role = null, $enabled = true, $group = null, $flush = true) |
|
40 | { |
|
@@ 170-186 (lines=17) @@ | ||
167 | /** |
|
168 | * @Given /^there are following games:$/ |
|
169 | */ |
|
170 | public function thereAreFollowingGames(TableNode $table) |
|
171 | { |
|
172 | foreach ($table->getHash() as $data) { |
|
173 | $this->thereIsGame( |
|
174 | $data['name'], |
|
175 | $data['launchName'], |
|
176 | !empty($data['appId']) ? $data['appId'] : null, |
|
177 | !empty($data['appMod']) ? $data['appMod'] : null, |
|
178 | $data['bin'], |
|
179 | $data['type'], |
|
180 | (isset($data['available']) && $data['available'] == 'yes'), |
|
181 | false |
|
182 | ); |
|
183 | } |
|
184 | ||
185 | $this->getEntityManager()->flush(); |
|
186 | } |
|
187 | ||
188 | public function thereIsGame( |
|
189 | $name, |