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

Add tests for getUsers #33146

Merged
merged 1 commit into from
Oct 11, 2018
Merged

Conversation

paurakhsharma
Copy link
Member

Description

This PR adds more tests for cliProvisioning getUsers using occ commands.

Related issue: #33052

How Has This Been Tested?

Locally

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

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.

@@ -425,9 +436,18 @@ public function theAppsReturnedByTheOccCommandShouldInclude(TableNode $appListTa
public function theUsersReturnedByTheOccCommandShouldBe(TableNode $useridTable) {
$lastOutput = $this->featureContext->getStdOutOfOccCommand();
$lastOutputUsers = \json_decode($lastOutput, true);
$result = [];
// check if an array is a multi-dimentional array with inner array key 'displayName'
if (\array_column($lastOutputUsers, 'displayName')) {
Copy link
Member Author

@paurakhsharma paurakhsharma Oct 11, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This check is because when we run occ command to get users from a group we get a single dimensional array but when we run occ command to get all users on ownCloud server we get multi-dimensional array

@@ -425,9 +436,18 @@ public function theAppsReturnedByTheOccCommandShouldInclude(TableNode $appListTa
public function theUsersReturnedByTheOccCommandShouldBe(TableNode $useridTable) {
$lastOutput = $this->featureContext->getStdOutOfOccCommand();
$lastOutputUsers = \json_decode($lastOutput, true);
$result = [];
// check if an array is a multi-dimentional array with inner array key 'displayName'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/dimentional/dimensional

@paurakhsharma paurakhsharma force-pushed the occTest-cliProvisioning-getUsers branch from a976333 to 834e454 Compare October 11, 2018 05:04
@codecov
Copy link

codecov bot commented Oct 11, 2018

Codecov Report

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

Impacted file tree graph

@@            Coverage Diff            @@
##             master   #33146   +/-   ##
=========================================
  Coverage     64.12%   64.12%           
  Complexity    18720    18720           
=========================================
  Files          1184     1184           
  Lines         70437    70437           
  Branches       1270     1270           
=========================================
  Hits          45171    45171           
  Misses        24896    24896           
  Partials        370      370
Flag Coverage Δ Complexity Δ
#javascript 52.89% <ø> (ø) 0 <ø> (ø) ⬇️
#phpunit 65.4% <ø> (ø) 18720 <ø> (ø) ⬇️

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 bb9f906...834e454. Read the comment docs.

@paurakhsharma paurakhsharma merged commit 96a24ea into master Oct 11, 2018
@paurakhsharma paurakhsharma deleted the occTest-cliProvisioning-getUsers branch October 11, 2018 05:35
@paurakhsharma
Copy link
Member Author

Backport on: #33148

@lock lock bot locked as resolved and limited conversation to collaborators Oct 11, 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