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

Test new case for Manager::userHasPermission() #260

Merged
merged 4 commits into from
Mar 4, 2024

Conversation

arogachev
Copy link
Contributor

@arogachev arogachev commented Mar 1, 2024

Q A
Is bugfix?
New feature?
Breaks BC?

Reported by @vjik. Unable to reproduce.

@arogachev arogachev marked this pull request as draft March 1, 2024 08:55
@arogachev arogachev requested a review from a team March 1, 2024 08:55
Copy link

what-the-diff bot commented Mar 1, 2024

PR Summary

  • Additional Import in ManagerLogicTestTrait.php

    • The Yiisoft\Rbac\Tests\Support\FalseRule import was added to ManagerLogicTestTrait.php. This is necessary for the implementation of new test conditions.
  • New Test Method: testUserHasPermissionTemp

    • A new test method was introduced in ManagerLogicTestTrait.php named testUserHasPermissionTemp. The purpose of this test is to verify whether a user possesses a certain permission. The test will output false if the user is assigned both Role 1 and Role 2 where Role 2 imposes FalseRule as its rule. This ensures that our system is correctly restraining permissions under specific conditions.

@arogachev arogachev requested a review from vjik March 1, 2024 08:55
@arogachev arogachev added the type:test Test label Mar 1, 2024
@arogachev arogachev self-assigned this Mar 1, 2024
@arogachev arogachev added this to the 2.0 milestone Mar 1, 2024
Copy link

codecov bot commented Mar 1, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (44912db) to head (4732b91).
Report is 1 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff             @@
##              master      #260   +/-   ##
===========================================
  Coverage     100.00%   100.00%           
+ Complexity       222       220    -2     
===========================================
  Files             14        14           
  Lines            552       553    +1     
===========================================
+ Hits             552       553    +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@arogachev arogachev changed the title Test new case for Manager::userHasPermission()` Test new case for Manager::userHasPermission() Mar 1, 2024
@arogachev arogachev removed request for vjik and a team March 1, 2024 13:08
@arogachev arogachev marked this pull request as ready for review March 2, 2024 09:01
@arogachev arogachev requested a review from a team March 2, 2024 09:01
@arogachev arogachev added type:bug Bug and removed type:test Test labels Mar 2, 2024
@arogachev arogachev merged commit 9603196 into master Mar 4, 2024
22 of 24 checks passed
@arogachev arogachev deleted the test-user-has-permission branch March 4, 2024 03:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants