respect-validation/tests/unit
Alexandre Gomes Gaigalas cd96d01364 Fix message overriding bug in NestedArrayFormatter
This commit resolves an issue where validation messages would overwrite
each other when multiple validators failed on the same path or key
(e.g., within an `Each` or `Key` validator).

Changes to `NestedArrayFormatter`:
- Implemented a merge strategy: Key collisions now result in a list of
  messages instead of the last message winning.
- Improved handling of mixed key types: When both numeric and string
  keys are present (common in composite validators), numeric keys are now
  replaced by the validator's ID (e.g., `arrayType`, `equals`) to provide
  meaningful, distinct keys.
- Preserved list behavior: Purely numeric key sets are treated as lists,
  maintaining their sequence without re-keying logic.
- Refactored the class to use smaller, single-purpose methods and
  `array_reduce` for clarity.

Tests:
- Updated feature tests (`EachTest`, `AttributesTest`, etc.) to expect the
  full set of validation errors.
- Enhanced `NestedArrayFormatterTest` with scenarios for key collisions,
  mixed keys, and ID substitution.
2026-01-12 10:42:11 +00:00
..
Exceptions Make proper use of exceptions in rules 2024-03-25 22:09:02 +01:00
Helpers Reset missing date information in CanValidateDateTime 2026-01-04 21:49:39 +01:00
Message Fix message overriding bug in NestedArrayFormatter 2026-01-12 10:42:11 +00:00
Transformers Rename RuleSpec to ValidatorSpec 2026-01-05 17:36:35 +01:00
Validators Remove Yes and No rules 2026-01-10 05:47:28 +01:00
ContainerRegistryTest.php Rename Validator to ValidatorBuilder 2026-01-05 11:57:40 +01:00
NamespacedRuleFactoryTest.php Rename namespace Rules to Validators 2026-01-05 17:36:35 +01:00
ResultQueryTest.php Enable validating inputs without throwing exceptions 2025-12-22 20:37:11 +01:00
ValidatorTest.php Rename namespace Rules to Validators 2026-01-05 17:36:35 +01:00