@@ -13,63 +13,80 @@ run([
1313 'Inverted nullined, not name ' => [v::not (v::nullOr (v::alpha ()))->setName ('Not ' ), null ],
1414 'With template ' => [v::nullOr (v::alpha ()), 123 , 'Nine nimble numismatists near Naples ' ],
1515 'With array template ' => [v::nullOr (v::alpha ()), 123 , ['nullOrAlpha ' => 'Next to nifty null notations ' ]],
16+ 'Inverted nullined with template ' => [
17+ v::not (v::nullOr (v::alpha ())),
18+ null ,
19+ ['notNullOrAlpha ' => 'Next to nifty null notations ' ],
20+ ],
21+ 'Not a sibling compatible rule ' => [
22+ v::nullOr (v::alpha ()->stringType ()),
23+ 1234 ,
24+ ],
25+ 'Not a sibling compatible rule with templates ' => [
26+ v::nullOr (v::alpha ()->stringType ()),
27+ 1234 ,
28+ [
29+ 'nullOrAlpha ' => 'Should be nul or alpha ' ,
30+ 'nullOrStringType ' => 'Should be nul or string type ' ,
31+ ],
32+ ],
1633]);
1734?>
1835--EXPECT--
1936Default
2037⎺⎺⎺⎺⎺⎺⎺
21- 1234 must contain only letters (a-z)
22- - 1234 must contain only letters (a-z)
38+ 1234 must contain only letters (a-z) or must be null
39+ - 1234 must contain only letters (a-z) or must be null
2340[
24- 'nullOrAlpha' => '1234 must contain only letters (a-z)',
41+ 'nullOrAlpha' => '1234 must contain only letters (a-z) or must be null ',
2542]
2643
2744Inverted wrapper
2845⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺
29- "alpha" must not contain letters (a-z)
30- - "alpha" must not contain letters (a-z)
46+ "alpha" must not contain letters (a-z) and must not be null
47+ - "alpha" must not contain letters (a-z) and must not be null
3148[
32- 'notNullOrAlpha' => '"alpha" must not contain letters (a-z)',
49+ 'notNullOrAlpha' => '"alpha" must not contain letters (a-z) and must not be null ',
3350]
3451
3552Inverted wrapped
3653⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺
37- "alpha" must not contain letters (a-z)
38- - "alpha" must not contain letters (a-z)
54+ "alpha" must not contain letters (a-z) or must be null
55+ - "alpha" must not contain letters (a-z) or must be null
3956[
40- 'nullOrNotAlpha' => '"alpha" must not contain letters (a-z)',
57+ 'nullOrNotAlpha' => '"alpha" must not contain letters (a-z) or must be null ',
4158]
4259
4360Inverted nullined
4461⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺
45- The value must not be null
46- - The value must not be null
62+ `null` must not contain letters (a-z) and must not be null
63+ - `null` must not contain letters (a-z) and must not be null
4764[
48- 'notNullOr ' => 'The value must not be null',
65+ 'notNullOrAlpha ' => '`null` must not contain letters (a-z) and must not be null',
4966]
5067
5168Inverted nullined, wrapped name
5269⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺
53- Wrapped must not be null
54- - Wrapped must not be null
70+ Wrapped must not contain letters (a-z) and must not be null
71+ - Wrapped must not contain letters (a-z) and must not be null
5572[
56- 'notNullOr ' => 'Wrapped must not be null',
73+ 'notNullOrAlpha ' => 'Wrapped must not contain letters (a-z) and must not be null',
5774]
5875
5976Inverted nullined, wrapper name
6077⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺
61- Wrapper must not be null
62- - Wrapper must not be null
78+ Wrapper must not contain letters (a-z) and must not be null
79+ - Wrapper must not contain letters (a-z) and must not be null
6380[
64- 'notNullOr ' => 'Wrapper must not be null',
81+ 'notNullOrAlpha ' => 'Wrapper must not contain letters (a-z) and must not be null',
6582]
6683
6784Inverted nullined, not name
6885⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺
69- Not must not be null
70- - Not must not be null
86+ Not must not contain letters (a-z) and must not be null
87+ - Not must not contain letters (a-z) and must not be null
7188[
72- 'notNullOr ' => 'Not must not be null',
89+ 'notNullOrAlpha ' => 'Not must not contain letters (a-z) and must not be null',
7390]
7491
7592With template
@@ -87,3 +104,35 @@ Next to nifty null notations
87104[
88105 'nullOrAlpha' => 'Next to nifty null notations',
89106]
107+
108+ Inverted nullined with template
109+ ⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺
110+ Next to nifty null notations
111+ - Next to nifty null notations
112+ [
113+ 'notNullOrAlpha' => 'Next to nifty null notations',
114+ ]
115+
116+ Not a sibling compatible rule
117+ ⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺
118+ 1234 must contain only letters (a-z) or must be null
119+ - All of the required rules must pass for 1234
120+ - 1234 must contain only letters (a-z) or must be null
121+ - 1234 must be of type string or must be null
122+ [
123+ '__root__' => 'All of the required rules must pass for 1234',
124+ 'nullOrAlpha' => '1234 must contain only letters (a-z) or must be null',
125+ 'nullOrStringType' => '1234 must be of type string or must be null',
126+ ]
127+
128+ Not a sibling compatible rule with templates
129+ ⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺
130+ Should be nul or alpha
131+ - All of the required rules must pass for 1234
132+ - Should be nul or alpha
133+ - Should be nul or string type
134+ [
135+ '__root__' => 'All of the required rules must pass for 1234',
136+ 'nullOrAlpha' => 'Should be nul or alpha',
137+ 'nullOrStringType' => 'Should be nul or string type',
138+ ]
0 commit comments