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: add tests for required_without #6559

Merged
merged 1 commit into from
Sep 22, 2022

Conversation

kenjis
Copy link
Member

@kenjis kenjis commented Sep 21, 2022

Description
To confirm the current behavior.

Checklist:

  • Securely signed commits
  • [] Component(s) with PHPDoc blocks, only if necessary or adds value
  • [] Unit testing, with >80% coverage
  • [] User guide updated
  • Conforms to style guide

@kenjis kenjis added the testing Pull requests that changes tests only label Sep 21, 2022
Copy link
Member

@MGatner MGatner left a comment

Choose a reason for hiding this comment

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

I'm not saying yet whether I agree or not with the other PR but it is good to have tests for existing behavior.

@kenjis
Copy link
Member Author

kenjis commented Sep 21, 2022

required_without
The field is required when all of the other fields are present in the data but not required.
https://codeigniter4.github.io/CodeIgniter4/libraries/validation.html#available-rules

It seems the explanation in the user guide is not correct, or I can't get it.
Is it correct?

How about this?

The field is required when any of the other fields do not pass required checks.

Copy link
Member

@michalsn michalsn left a comment

Choose a reason for hiding this comment

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

The field is required when any of the other fields do not pass required checks.

Sounds correct. The user guide description is very unfortunate.

@kenjis kenjis mentioned this pull request Sep 22, 2022
2 tasks
@kenjis kenjis merged commit 303ec58 into codeigniter4:develop Sep 22, 2022
@kenjis kenjis deleted the add-test-required_without branch September 22, 2022 06:29
@MGatner
Copy link
Member

MGatner commented Sep 22, 2022

Yes yours is much better.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
testing Pull requests that changes tests only
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants