Skip to content

Adjust all type-specific/rule-dedicated methods to check only their own validation rule - #40

Open
Neluxx wants to merge 17 commits into
cakephp-5.xfrom
38-check-only-own-validation-rule
Open

Adjust all type-specific/rule-dedicated methods to check only their own validation rule#40
Neluxx wants to merge 17 commits into
cakephp-5.xfrom
38-check-only-own-validation-rule

Conversation

@Neluxx

@Neluxx Neluxx commented Aug 26, 2026

Copy link
Copy Markdown
Member

Closes #38

@Neluxx
Neluxx requested a review from ravage84 August 26, 2026 09:39
@Neluxx Neluxx self-assigned this Aug 26, 2026

@ravage84 ravage84 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think this will be a big step forward! 🙏

Comment thread src/Traits/DataValidationTestTrait.php Outdated
Comment thread docs/Usage.md
Comment thread docs/Usage.md Outdated
Comment thread tests/TestApp/Model/Table/ValidationTestTable.php
Comment thread tests/TestCase/Traits/DataValidationTestTraitTest.php Outdated
Comment thread tests/TestCase/Traits/DataValidationTestTraitTest.php
Comment thread tests/TestCase/Traits/DataValidationTestTraitTest.php Outdated
Comment thread tests/TestCase/Traits/DataValidationTestTraitTest.php Outdated
Comment thread tests/TestCase/Traits/DataValidationTestTraitTest.php Outdated
Comment thread CHANGELOG.md Outdated
@Neluxx
Neluxx requested a review from ravage84 August 27, 2026 13:03
Comment thread docs/Usage.md
- `testDataValidationNotContains($table, $fieldName, $dataSet, $rules)` - asserts the given rule names are **not** present on the field, ignoring any other errors.
- `testDataValidationNoErrors($table, $fieldName, $dataSet)` - asserts a data set produces no errors on the field.
- `testDataValidationInList($table, $list, $fieldName, $expected)` - runs the same assertion for each value in a list.
- `testDataValidationInList($table, $list, $fieldName, $expected)` - runs the complete-error-array assertion for each value in a list.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

InList`` is actually a type validation.

https://api.cakephp.org/5.3/class-Cake.Validation.Validation.html#inList()

Let's move it.

Comment thread docs/Usage.md
- `testDataValidationNoErrors($table, $fieldName, $dataSet)` - asserts a data set produces no errors on the field.
- `testDataValidationInList($table, $list, $fieldName, $expected)` - runs the same assertion for each value in a list.
- `testDataValidationInList($table, $list, $fieldName, $expected)` - runs the complete-error-array assertion for each value in a list.
- `testDataValidationInListContains($table, $list, $fieldName, $expected)` - runs the `contains` assertion for each value in a list.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Since InList is an actual validation method, I think these two methods should be renamed. I think just taking away the In would prevent mix-ups.

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.

Adjust all type-specific/rule-dedicated methods to check only their own validation rule

3 participants