gajus / vlad

Input validation library promoting succinct syntax with extendable validators and multilingual support.
Other
104 stars 8 forks source link

"silent" validation failure scenario does not work #2

Closed gajus closed 10 years ago

gajus commented 10 years ago
$test = $vlad->test([
    [
        ['foo'],
        [
            ['fail' => 'silent'],
            'email'
        ]
    ],
    [
        ['foo'],
        [
            ['length', 'max' => 10]
        ]
    ]
]);

In the above scenario, if "foo" fails to pass "email" test it will not progress to "length" test in the next sub-test. This is happening because the current test implementation scopes all the validation rules under the selector without identifying separate groups.

There is no way to identify the failing sub-test.

Possible solution is to create multiple tests, each per an array defined test group and merge the end result.

gajus commented 10 years ago

Fixed 2be8f5d25d57c6935d4bf5ddfaca14f70eb60ee4.