Skip to content

Commit

Permalink
fix provisioning test check
Browse files Browse the repository at this point in the history
Signed-off-by: Arthur Schiwon <[email protected]>
  • Loading branch information
blizzz committed Jun 25, 2021
1 parent 3561025 commit 4d0d14b
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions build/integration/features/bootstrap/Provisioning.php
Original file line number Diff line number Diff line change
Expand Up @@ -168,15 +168,16 @@ public function userHasSetting($user, $settings) {
$response = $client->get($fullUrl, $options);
foreach ($settings->getRows() as $setting) {
$value = json_decode(json_encode(simplexml_load_string($response->getBody())->data->{$setting[0]}), 1);
if (isset($value[0])) {
if (in_array($setting[0], ['additional_mail', 'additional_mailScope'], true)) {
$expectedValues = explode(';', $setting[1]);
foreach ($expectedValues as $expected) {
Assert::assertTrue(in_array($expected, $value, true));
}
} else {
Assert::assertEquals($setting[1], $value[0], "", 0.0, 10, true);
if (in_array($setting[0], ['additional_mail', 'additional_mailScope'], true)) {
var_dump($value);
}
if (isset($value['element']) && in_array($setting[0], ['additional_mail', 'additional_mailScope'], true)) {
$expectedValues = explode(';', $setting[1]);
foreach ($expectedValues as $expected) {
Assert::assertTrue(in_array($expected, $value['element'], true));
}
} elseif (isset($value[0])) {
Assert::assertEquals($setting[1], $value[0], "", 0.0, 10, true);
} else {
Assert::assertEquals('', $setting[1]);
}
Expand Down

0 comments on commit 4d0d14b

Please sign in to comment.