Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make acceptance test function getUserDisplayName more robust #31755

Merged
merged 1 commit into from
Jun 13, 2018

Conversation

phil-davis
Copy link
Contributor

@phil-davis phil-davis commented Jun 13, 2018

Signed-off-by: Phil Davis [email protected]

Description

Check if the displayname array entry for the user exists before accessing it.

Related Issue

#31747

Motivation and Context

The code in getUserDisplayName() could fail with:

Notice: Undefined index: user1 in /var/www/owncloud/tests/acceptance/features/bootstrap/Provisioning.php line 103

if passed a username that it knew nothing about.
That happened in a scenario run from user_ldap app.
Make it more robust so that it returns the passed-in username if it cannot find a displayname.

How Has This Been Tested?

Local run of:

bash tests/travis/start_ui_tests.sh --feature tests/acceptance/features/webUISharingInternalUsers/shareAutocompletion.feature:106

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Acceptance test code fix

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@codecov
Copy link

codecov bot commented Jun 13, 2018

Codecov Report

Merging #31755 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##             master   #31755   +/-   ##
=========================================
  Coverage     63.17%   63.17%           
  Complexity    18445    18445           
=========================================
  Files          1158     1158           
  Lines         69288    69288           
  Branches       1261     1261           
=========================================
  Hits          43770    43770           
  Misses        25148    25148           
  Partials        370      370
Flag Coverage Δ Complexity Δ
#javascript 52.47% <ø> (ø) 0 <ø> (ø) ⬇️
#phpunit 64.39% <ø> (ø) 18445 <ø> (ø) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9946a2b...988777e. Read the comment docs.

@phil-davis phil-davis merged commit bb379c1 into master Jun 13, 2018
@phil-davis phil-davis deleted the robust-getUserDisplayName branch June 13, 2018 15:31
@phil-davis
Copy link
Contributor Author

Backport stable10 #31756

@lock
Copy link

lock bot commented Jul 30, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Jul 30, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants