respect-validation/tests/feature
Henrique Moody d4605f4493
Add wildcard support to ResultQuery::findByPath()
Before this change, querying validation results required knowing the
exact path to a specific result node—including numeric indices for
array elements (e.g., `items.1.email`). This made it impractical to
locate the first failing result in dynamic collections where the
failing index is not known ahead of time.

Wildcard segments (`*`) allow matching any single path component, so
patterns like `items.*`, `*.email`, or `data.*.value` will traverse
the result tree and return the first node whose path matches. This is
particularly valuable when validating arrays of items with `each()`,
because consumers can now ask "give me the first failure under items"
without iterating manually.

The implementation replaces the previous flat `array_find` lookup with
a recursive depth-first traversal that, when a wildcard is present,
compares each node's full path against the pattern using segment-level
matching. Non-wildcard lookups continue to use exact array equality,
so there is no behavioral change for existing callers.

Assisted-by: Claude Code (claude-opus-4-6)
2026-02-08 22:43:06 +01:00
..
Issues Standardize and improve validation message templates 2026-02-03 19:58:55 +00:00
Readme Standardize and improve validation message templates 2026-02-03 19:58:55 +00:00
Transformers Standardize and improve validation message templates 2026-02-03 19:58:55 +00:00
ValidatorBuilder Create ShortCircuit validator and ShortCircuitable interface 2026-02-05 17:32:42 +01:00
Validators Remove Masked validator in favor of Formatted 2026-02-06 20:44:26 +01:00
AssertWithKeysTest.php Fix SPDX headers in all files 2026-02-03 15:23:23 +01:00
AssertWithPropertiesTest.php Fix SPDX headers in all files 2026-02-03 15:23:23 +01:00
AssertWithTemplatesTest.php Fix SPDX headers in all files 2026-02-03 15:23:23 +01:00
DoNotRelyOnNestedValidationExceptionInterfaceForCheckTest.php Standardize and improve validation message templates 2026-02-03 19:58:55 +00:00
GetFullMessageShouldIncludeAllValidationMessagesInAChainTest.php Standardize and improve validation message templates 2026-02-03 19:58:55 +00:00
GetMessagesShouldIncludeAllValidationMessagesInAChainTest.php Standardize and improve validation message templates 2026-02-03 19:58:55 +00:00
GetMessagesTest.php Fix SPDX headers in all files 2026-02-03 15:23:23 +01:00
GetMessagesWithReplacementsTest.php Fix SPDX headers in all files 2026-02-03 15:23:23 +01:00
HandlingNamesTest.php Standardize and improve validation message templates 2026-02-03 19:58:55 +00:00
KeysAsValidatorNamesTest.php Standardize and improve validation message templates 2026-02-03 19:58:55 +00:00
NotShouldWorkWithBuilderTestTest.php Fix SPDX headers in all files 2026-02-03 15:23:23 +01:00
NotWithoutRecursionTest.php Standardize and improve validation message templates 2026-02-03 19:58:55 +00:00
NotWithRecursionTest.php Standardize and improve validation message templates 2026-02-03 19:58:55 +00:00
ResultQueryTest.php Add wildcard support to ResultQuery::findByPath() 2026-02-08 22:43:06 +01:00
SerializableTest.php Remove mathematical, niche and deprecated validators 2026-01-30 16:08:27 +00:00
SetTemplateWithMultipleValidatorsShouldUseTemplateAsFullMessageHeaderTest.php Fix SPDX headers in all files 2026-02-03 15:23:23 +01:00
SetTemplateWithMultipleValidatorsShouldUseTemplateAsMainMessageTest.php Fix SPDX headers in all files 2026-02-03 15:23:23 +01:00
SetTemplateWithSingleValidatorShouldUseTemplateAsMainMessageTest.php Fix SPDX headers in all files 2026-02-03 15:23:23 +01:00
TranslatorTest.php Update translation docs 2026-02-06 17:11:34 +00:00
ValidationExceptionStackTraceTest.php Fix SPDX headers in all files 2026-02-03 15:23:23 +01:00