Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
briskt committed May 22, 2020
2 parents 920535d + 9b03050 commit 5d5e4d4
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/).

## [Unreleased]

## [4.0.2] - 2020-05-22
### Fixed
- Fixed null check on groupsField in Workday user array

## [4.0.1] - 2020-05-19
### Fixed
- Fixed null check on groupsField in Workday user array
Expand Down
5 changes: 3 additions & 2 deletions application/common/components/adapters/WorkdayIdStore.php
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,9 @@ public function generateGroupsLists(array &$users)
foreach ($users as $key => $user) {
$groups = [];
foreach ($groupsFields as $groupsField) {
if (strlen($user[$groupsField]) > 0) {
$groupsSubList = explode(' ', $user[$groupsField] ?? '');
$value = $user[$groupsField] ?? '';
if (strlen($value) > 0) {
$groupsSubList = explode(' ', $value);
$groups = array_merge($groups, $groupsSubList);
}
}
Expand Down
6 changes: 2 additions & 4 deletions application/tests/WorkdayIdStoreTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,26 +47,24 @@ public function testGenerateGroupsListsCustom()
$this->assertEquals('x,y,z,1,2,3', $users[0]['Groups']);
}

public function testGenerateGroupsListsEmptyCompanyIDs()
public function testGenerateGroupsListsMissingCompanyIDs()
{
$idStore = $this->getWorkdayIdStore();
$users = [
[
'company_ids' => '',
'ou_tree' => 'd e f',
],
];
$idStore->generateGroupsLists($users);
$this->assertEquals('d,e,f', $users[0]['Groups']);
}

public function testGenerateGroupsListsEmptyOUTree()
public function testGenerateGroupsListsMissingOUTree()
{
$idStore = $this->getWorkdayIdStore();
$users = [
[
'company_ids' => 'a b c',
'ou_tree' => '',
],
];
$idStore->generateGroupsLists($users);
Expand Down

0 comments on commit 5d5e4d4

Please sign in to comment.