コード例 #1
0
 public static function provideMappings()
 {
     $ruleMapper = new ComponentRuleMapper();
     $tests = array();
     $test = function ($component, $rule) use(&$tests, $ruleMapper) {
         $tests[] = array($ruleMapper->createRule($rule), $component);
     };
     // delegates to typeRuleMapper
     $component = new IntegerField();
     $component->setType(Type::create('Id'));
     $test($component, 'Psc\\Form\\IdValidatorRule');
     $component = new TextField();
     $component->setType(Type::create('String'));
     $test($component, 'Psc\\Form\\NesValidatorRule');
     // eigene Componenten-Rules
     $component = new DatePicker();
     $component->init();
     $test($component, 'Psc\\Form\\DateValidatorRule');
     return $tests;
 }