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

integration tests for the invite function #77

Merged
merged 15 commits into from
Dec 1, 2023

Conversation

individual-it
Copy link
Member

@individual-it individual-it commented Nov 17, 2023

Some first tests for the invite function of resources.

This depends on owncloud/libre-graph-api#147 or resolution of the problem in ocis

@delete-merged-branch delete-merged-branch bot deleted the branch main November 17, 2023 07:24
@phil-davis
Copy link
Contributor

phil-davis commented Nov 21, 2023

@individual-it this PR branch needs to be rebased.
#78 (comment)

@individual-it individual-it changed the base branch from sharing to main November 22, 2023 03:48
@individual-it individual-it marked this pull request as ready for review November 30, 2023 09:36
@individual-it individual-it self-assigned this Nov 30, 2023
Comment on lines +133 to +134
$this->resourceToShare->invite([$this->einstein], $this->viewerRole);
$this->resourceToShare->invite([$this->einstein], $this->viewerRole);
Copy link
Contributor

Choose a reason for hiding this comment

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

how about using anotherRole for second invite

Suggested change
$this->resourceToShare->invite([$this->einstein], $this->viewerRole);
$this->resourceToShare->invite([$this->einstein], $this->viewerRole);
$this->resourceToShare->invite([$this->einstein], $this->viewerRole);
$this->resourceToShare->invite([$this->einstein], $this->anotherRole);

$this->assertSame($this->resourceToShare->getName(), $receivedShares[0]->getName());
}

public function testInviteGroupAndUserOfTheGroup(): void
Copy link
Contributor

Choose a reason for hiding this comment

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

testInviteMultipleGroupWithCommonUser can be added too

@individual-it
Copy link
Member Author

I've added two more tests. Generally we have to find the right balance of testing here, we want to test all the code of the SDK including all edge cases we can think of, but on the other hand we don't need to test ocis in our tests. Testing if the API of ocis behaves correctly is part of the tests in ocis

Copy link

sonarqubecloud bot commented Dec 1, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

Copy link
Contributor

@amrita-shrestha amrita-shrestha left a comment

Choose a reason for hiding this comment

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

lgtm

@individual-it individual-it merged commit d5c6abf into main Dec 1, 2023
3 checks passed
@individual-it individual-it deleted the inviteIntegrationTests branch December 1, 2023 06:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants