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 methods to RulesChecker to remove rules. #17634

Merged
merged 2 commits into from Apr 1, 2024

Conversation

ADmad
Copy link
Member

@ADmad ADmad commented Mar 16, 2024

Refs #17610

I'll add more tests for code coverage once the PR is approved in principle.

@ADmad ADmad added this to the 5.1.0 milestone Mar 16, 2024
@othercorey
Copy link
Member

othercorey commented Mar 20, 2024

The change looks reasonable, but I don't know much about the use cases.

@ADmad ADmad requested a review from markstory March 21, 2024 02:06
Copy link
Member

@markstory markstory left a comment

Choose a reason for hiding this comment

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

Makes sense to me. Requiring rules to have names in order to use remove methods on them is a good approach .

Comment on lines +207 to +208
$rules->remove('ruleName');
$this->assertTrue($rules->check($entity, RulesChecker::CREATE));
Copy link
Member

Choose a reason for hiding this comment

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

We should have tests for the other remove* methods as well.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done

markstory added a commit to cakephp/docs that referenced this pull request Apr 1, 2024
@markstory markstory merged commit dde2648 into 5.next Apr 1, 2024
10 checks passed
@markstory markstory deleted the 5.1-rules-checker-remove branch April 1, 2024 15:09
ADmad added a commit to cakephp/docs that referenced this pull request Apr 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants