]> saetta.ns0.it Git - zakform/tests/commitdiff
Added test for ZakFormValidatorComposite.
authorAndrea Zagli <azagli@libero.it>
Sun, 14 May 2017 15:26:49 +0000 (17:26 +0200)
committerAndrea Zagli <azagli@libero.it>
Sun, 14 May 2017 15:26:49 +0000 (17:26 +0200)
data/zakformtests/xml/main.xml

index 063566a47a13001c784023695df910b12e560fc6..b53419ccd46a254ee22e46df9b716de2e876fe41 100644 (file)
@@ -141,4 +141,16 @@ and                                         some            tabs
 
   <validator type="zak_form_validator_compare_date" type_comp="lt" element1="date_from" format1="%d/%m/%Y" element2="date_to" format2="%d/%m/%Y"></validator>
 
+  <validator type="zak_form_validator_composite">
+       <logic type="or" message="It needs to be valued «Birthday» or «Date from» and «date to»">
+         <logic type="and">
+               <validator type="zak_form_element_validator_notempty" element="date_from"></validator>
+               <validator type="zak_form_element_validator_notempty" element="date_to"></validator>
+         </logic>
+         <logic type="and">
+               <validator type="zak_form_element_validator_notempty" element="birthday"></validator>
+         </logic>
+       </logic>
+  </validator>
+
 </zakform>