Changeset 439

Show
Ignore:
Timestamp:
05/15/07 22:56:49 (2 years ago)
Author:
laurentj
Message:

worked on jforms : more unit tests on the compiler

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/experimental/jforms/build/manifests/jelix-lib.mn

    r437 r439  
    223223  common.ISO-8859-1.properties 
    224224  format.ISO-8859-1.properties 
     225  formserr.ISO-8859-1.properties 
    225226  jelix.ISO-8859-1.properties 
    226227  errors.ISO-8859-1.properties 
     
    232233  common.UTF-8.properties 
    233234  format.UTF-8.properties 
     235  formserr.UTF-8.properties 
    234236  jelix.UTF-8.properties 
    235237  errors.UTF-8.properties 
     
    242244  common.ISO-8859-1.properties 
    243245  format.ISO-8859-1.properties 
     246  formserr.ISO-8859-1.properties 
    244247  jelix.ISO-8859-1.properties 
    245248  errors.ISO-8859-1.properties 
     
    251254  common.UTF-8.properties 
    252255  format.UTF-8.properties 
     256  formserr.UTF-8.properties 
    253257  jelix.UTF-8.properties 
    254258  errors.UTF-8.properties 
     
    261265  common.ISO-8859-1.properties 
    262266  format.ISO-8859-1.properties 
     267  formserr.ISO-8859-1.properties 
    263268  jelix.ISO-8859-1.properties 
    264269  errors.ISO-8859-1.properties 
     
    270275  common.UTF-8.properties 
    271276  format.UTF-8.properties 
     277  formserr.UTF-8.properties 
    272278  jelix.UTF-8.properties 
    273279  errors.UTF-8.properties 
  • branches/experimental/jforms/lib/jelix-modules/jelix/locales/en_US/formserr.ISO-8859-1.properties

    r97 r439  
    22unknow.tag=(801) unknow tag %1$s  (file %2$s) 
    33attribute.missing=(802) attribut %1$s is missing on %2$s (file %3$s) 
    4 datatype.unknow=(803) unknow datatype %1$s  on %2$s (file %3$s) 
     4attribute.not.allowed=(803) attribut %1$s not allowed on %2$s (file %3$s) 
     5datatype.unknow=(804) unknow datatype %1$s  on %2$s (file %3$s) 
    56 
  • branches/experimental/jforms/lib/jelix-modules/jelix/locales/fr_FR/formserr.ISO-8859-1.properties

    r97 r439  
    22unknow.tag=(801) balise %1$s inconnue (fichier %2$s) 
    33attribute.missing=(802) attribut %1$s manquant sur %2$s (fichier %3$s) 
    4 datatype.unknow=(803) datatype inconnu %1$s sur %2$s (fichier %3$s) 
     4attribute.not.allowed=(803) attribut %1$s non permis sur %2$s (fichier %3$s) 
     5datatype.unknow=(804) datatype inconnu %1$s sur %2$s (fichier %3$s) 
    56 
     7 
  • branches/experimental/jforms/lib/jelix-modules/jelix/locales/fr_FR/formserr.UTF-8.properties

    r112 r439  
    22unknow.tag=(801) balise %1$s inconnue (fichier %2$s) 
    33attribute.missing=(802) attribut %1$s manquant sur %2$s (fichier %3$s) 
    4 datatype.unknow=(803) datatype inconnu %1$s sur %2$s (fichier %3$s) 
     4attribute.not.allowed=(803) attribut %1$s non permis sur %2$s (fichier %3$s) 
     5datatype.unknow=(804) datatype inconnu %1$s sur %2$s (fichier %3$s) 
    56 
  • branches/experimental/jforms/lib/jelix/forms/jFormsBase.class.php

    r437 r439  
    5151    protected $_builders = array(); 
    5252 
    53  
    54      
    5553    /** 
    5654     * @param jFormsDataContainer $container the datas container 
  • branches/experimental/jforms/lib/jelix/forms/jFormsCompiler.class.php

    r437 r439  
    105105         $source[]='$ctrl= new '.$class.'(\''.(string)$control['ref'].'\');'; 
    106106         if(isset($control['type'])){ 
     107            if($controltype != 'input'){ 
     108                throw new jException('jelix~formserr.attribute.not.allowed',array('type',$controltype,$this->sourceFile)); 
     109            } 
     110 
    107111            $dt = (string)$control['type']; 
    108112            if(!in_array(strtolower($dt), array('string','boolean','decimal','integer','hexadecimal','datetime','date','time','localedatetime','localedate','localetime', 'url','email','ipv4','ipv6'))){ 
     
    139143 
    140144         switch($controltype){ 
    141             case 'input': 
    142                break; 
    143             case 'textarea': 
    144                break; 
    145             case 'secret': 
    146                break; 
    147             case 'output': 
    148                 //attr value 
    149                break; 
    150             case 'upload': 
    151                 // attr mediatype 
    152                break; 
    153145            case 'select1': 
    154146            case 'select': 
     
    179171                } 
    180172               break; 
    181             case 'submit': 
    182                 // attr value 
    183                break; 
    184173         } 
    185174         $source[]='$this->addControl($ctrl);'; 
     
    218207 
    219208         switch($controltype){ 
    220             case 'input': 
    221                break; 
    222             case 'textarea': 
    223                break; 
    224209            case 'secret': 
    225210               break; 
  • branches/experimental/jforms/testapp/modules/unittest/classes/utjforms.class.php

    r437 r439  
    3030 
    3131    protected $_XmlControls = array( 
    32 '<input ref="nom" xmlns="http://jelix.org/ns/forms/1.0"> 
    33     <label>Votre nom</label> 
    34 </input>', 
    35 '<input ref="nom" readonly="true" xmlns="http://jelix.org/ns/forms/1.0"> 
    36     <label>Votre nom</label> 
    37 </input>', 
    38 '<input ref="nom" required="true" xmlns="http://jelix.org/ns/forms/1.0"> 
    39     <label>Votre nom</label> 
    40 </input>', 
    41 '<input ref="nom" xmlns="http://jelix.org/ns/forms/1.0"> 
     320=>'<input ref="nom" xmlns="http://jelix.org/ns/forms/1.0"> 
     33    <label>Votre nom</label> 
     34</input>', 
     351=>'<input ref="nom" readonly="true" xmlns="http://jelix.org/ns/forms/1.0"> 
     36    <label>Votre nom</label> 
     37</input>', 
     382=>'<input ref="nom" required="true" xmlns="http://jelix.org/ns/forms/1.0"> 
     39    <label>Votre nom</label> 
     40</input>', 
     413=>'<input ref="nom" xmlns="http://jelix.org/ns/forms/1.0"> 
    4242    <label locale="foo~bar"/> 
    4343</input>', 
    4444 
    45 '<textarea ref="nom" xmlns="http://jelix.org/ns/forms/1.0"> 
     454=>'<textarea ref="nom" xmlns="http://jelix.org/ns/forms/1.0"> 
    4646    <label>Votre nom</label> 
    4747</textarea>', 
    4848 
    49 '<secret ref="nom" xmlns="http://jelix.org/ns/forms/1.0"> 
     495=>'<secret ref="nom" xmlns="http://jelix.org/ns/forms/1.0"> 
    5050    <label>Votre nom</label> 
    5151</secret>', 
    5252 
    53 '<output ref="nom" xmlns="http://jelix.org/ns/forms/1.0"> 
     536=>'<output ref="nom" xmlns="http://jelix.org/ns/forms/1.0"> 
    5454    <label>Votre nom</label> 
    5555</output>', 
    5656 
    57 '<upload ref="nom" xmlns="http://jelix.org/ns/forms/1.0"> 
     577=>'<upload ref="nom" xmlns="http://jelix.org/ns/forms/1.0"> 
    5858    <label>Votre nom</label> 
    5959</upload>', 
    6060 
    61 '<select1 ref="nom" xmlns="http://jelix.org/ns/forms/1.0" 
     618=>'<select1 ref="nom" xmlns="http://jelix.org/ns/forms/1.0" 
    6262    dao="foo" daomethod="bar" daolabelproperty="baz" daovalueproperty="plop"> 
    6363    <label>Votre nom</label> 
    6464</select1>', 
    6565 
    66 '<select ref="nom" xmlns="http://jelix.org/ns/forms/1.0"> 
     669=>'<select ref="nom" xmlns="http://jelix.org/ns/forms/1.0"> 
    6767    <label>Votre nom</label> 
    6868    <item label="1aa" value="aaa" /> 
     
    7171</select>', 
    7272 
    73 '<submit ref="nom" xmlns="http://jelix.org/ns/forms/1.0"> 
     7310=>'<submit ref="nom" xmlns="http://jelix.org/ns/forms/1.0"> 
    7474    <label>Votre nom</label> 
    7575</submit>', 
    7676 
     7711=>'<input ref="nom" type="string" xmlns="http://jelix.org/ns/forms/1.0"> 
     78    <label>Votre nom</label> 
     79</input>', 
     8012=>'<input ref="nom" type="boolean" xmlns="http://jelix.org/ns/forms/1.0"> 
     81    <label>Votre nom</label> 
     82</input>', 
     8313=>'<input ref="nom" type="decimal" xmlns="http://jelix.org/ns/forms/1.0"> 
     84    <label>Votre nom</label> 
     85</input>', 
     8614=>'<input ref="nom" type="integer" xmlns="http://jelix.org/ns/forms/1.0"> 
     87    <label>Votre nom</label> 
     88</input>', 
     8915=>'<input ref="nom" type="hexadecimal" xmlns="http://jelix.org/ns/forms/1.0"> 
     90    <label>Votre nom</label> 
     91</input>', 
     9216=>'<input ref="nom" type="datetime" xmlns="http://jelix.org/ns/forms/1.0"> 
     93    <label>Votre nom</label> 
     94</input>', 
     9517=>'<input ref="nom" type="date" xmlns="http://jelix.org/ns/forms/1.0"> 
     96    <label>Votre nom</label> 
     97</input>', 
     9818=>'<input ref="nom" type="time" xmlns="http://jelix.org/ns/forms/1.0"> 
     99    <label>Votre nom</label> 
     100</input>', 
     10119=>'<input ref="nom" type="localedatetime" xmlns="http://jelix.org/ns/forms/1.0"> 
     102    <label>Votre nom</label> 
     103</input>', 
     10420=>'<input ref="nom" type="localedate" xmlns="http://jelix.org/ns/forms/1.0"> 
     105    <label>Votre nom</label> 
     106</input>', 
     10721=>'<input ref="nom" type="localetime" xmlns="http://jelix.org/ns/forms/1.0"> 
     108    <label>Votre nom</label> 
     109</input>', 
     11022=>'<input ref="nom" type="url" xmlns="http://jelix.org/ns/forms/1.0"> 
     111    <label>Votre nom</label> 
     112</input>', 
     11323=>'<input ref="nom" type="email" xmlns="http://jelix.org/ns/forms/1.0"> 
     114    <label>Votre nom</label> 
     115</input>', 
     11624=>'<input ref="nom" type="ipv4" xmlns="http://jelix.org/ns/forms/1.0"> 
     117    <label>Votre nom</label> 
     118</input>', 
     11925=>'<input ref="nom" type="ipv6" xmlns="http://jelix.org/ns/forms/1.0"> 
     120    <label>Votre nom</label> 
     121</input>', 
    77122    ); 
    78123 
    79124    protected $_PhpControls = array( 
    80125 
    81 '$ctrl= new jFormsControlinput(\'nom\'); 
    82 $ctrl->datatype= new jDatatypeString(); 
    83 $ctrl->label=\'Votre nom\'; 
    84 $this->addControl($ctrl);', 
    85  
    86 '$ctrl= new jFormsControlinput(\'nom\'); 
     1260=>'$ctrl= new jFormsControlinput(\'nom\'); 
     127$ctrl->datatype= new jDatatypeString(); 
     128$ctrl->label=\'Votre nom\'; 
     129$this->addControl($ctrl);', 
     130 
     1311=>'$ctrl= new jFormsControlinput(\'nom\'); 
    87132$ctrl->datatype= new jDatatypeString(); 
    88133$ctrl->readonly=true; 
     
    90135$this->addControl($ctrl);', 
    91136 
    92 '$ctrl= new jFormsControlinput(\'nom\'); 
     1372=>'$ctrl= new jFormsControlinput(\'nom\'); 
    93138$ctrl->datatype= new jDatatypeString(); 
    94139$ctrl->required=true; 
     
    96141$this->addControl($ctrl);', 
    97142 
    98 '$ctrl= new jFormsControlinput(\'nom\'); 
     1433=>'$ctrl= new jFormsControlinput(\'nom\'); 
    99144$ctrl->datatype= new jDatatypeString(); 
    100145$ctrl->labellocale=\'foo~bar\'; 
     
    102147 
    103148 
    104 '$ctrl= new jFormsControltextarea(\'nom\'); 
    105 $ctrl->datatype= new jDatatypeString(); 
    106 $ctrl->label=\'Votre nom\'; 
    107 $this->addControl($ctrl);', 
    108  
    109  
    110 '$ctrl= new jFormsControlsecret(\'nom\'); 
    111 $ctrl->datatype= new jDatatypeString(); 
    112 $ctrl->label=\'Votre nom\'; 
    113 $this->addControl($ctrl);', 
    114  
    115 '$ctrl= new jFormsControloutput(\'nom\'); 
    116 $ctrl->datatype= new jDatatypeString(); 
    117 $ctrl->label=\'Votre nom\'; 
    118 $this->addControl($ctrl);', 
    119  
    120  
    121 '$ctrl= new jFormsControlupload(\'nom\'); 
    122 $ctrl->datatype= new jDatatypeString(); 
    123 $ctrl->label=\'Votre nom\'; 
    124 $this->addControl($ctrl);', 
    125  
    126  
    127 '$ctrl= new jFormsControlselect1(\'nom\'); 
     1494=>'$ctrl= new jFormsControltextarea(\'nom\'); 
     150$ctrl->datatype= new jDatatypeString(); 
     151$ctrl->label=\'Votre nom\'; 
     152$this->addControl($ctrl);', 
     153 
     154 
     1555=>'$ctrl= new jFormsControlsecret(\'nom\'); 
     156$ctrl->datatype= new jDatatypeString(); 
     157$ctrl->label=\'Votre nom\'; 
     158$this->addControl($ctrl);', 
     159 
     1606=>'$ctrl= new jFormsControloutput(\'nom\'); 
     161$ctrl->datatype= new jDatatypeString(); 
     162$ctrl->label=\'Votre nom\'; 
     163$this->addControl($ctrl);', 
     164 
     165 
     1667=>'$ctrl= new jFormsControlupload(\'nom\'); 
     167$ctrl->datatype= new jDatatypeString(); 
     168$ctrl->label=\'Votre nom\'; 
     169$this->addControl($ctrl);', 
     170 
     171 
     1728=>'$ctrl= new jFormsControlselect1(\'nom\'); 
    128173$ctrl->datatype= new jDatatypeString(); 
    129174$ctrl->label=\'Votre nom\'; 
     
    131176$this->addControl($ctrl);', 
    132177 
    133 '$ctrl= new jFormsControlselect(\'nom\'); 
     1789=>'$ctrl= new jFormsControlselect(\'nom\'); 
    134179$ctrl->datatype= new jDatatypeString(); 
    135180$ctrl->label=\'Votre nom\'; 
     
    142187$this->addControl($ctrl);', 
    143188 
    144 '$ctrl= new jFormsControlsubmit(\'nom\'); 
    145 $ctrl->datatype= new jDatatypeString(); 
     18910=>'$ctrl= new jFormsControlsubmit(\'nom\'); 
     190$ctrl->datatype= new jDatatypeString(); 
     191$ctrl->label=\'Votre nom\'; 
     192$this->addControl($ctrl);', 
     193 
     19411=>'$ctrl= new jFormsControlinput(\'nom\'); 
     195$ctrl->datatype= new jDatatypestring(); 
     196$ctrl->label=\'Votre nom\'; 
     197$this->addControl($ctrl);', 
     19812=>'$ctrl= new jFormsControlinput(\'nom\'); 
     199$ctrl->datatype= new jDatatypeboolean(); 
     200$ctrl->label=\'Votre nom\'; 
     201$this->addControl($ctrl);', 
     20213=>'$ctrl= new jFormsControlinput(\'nom\'); 
     203$ctrl->datatype= new jDatatypedecimal(); 
     204$ctrl->label=\'Votre nom\'; 
     205$this->addControl($ctrl);', 
     20614=>'$ctrl= new jFormsControlinput(\'nom\'); 
     207$ctrl->datatype= new jDatatypeinteger(); 
     208$ctrl->label=\'Votre nom\'; 
     209$this->addControl($ctrl);', 
     21015=>'$ctrl= new jFormsControlinput(\'nom\'); 
     211$ctrl->datatype= new jDatatypehexadecimal(); 
     212$ctrl->label=\'Votre nom\'; 
     213$this->addControl($ctrl);', 
     21416=>'$ctrl= new jFormsControlinput(\'nom\'); 
     215$ctrl->datatype= new jDatatypedatetime(); 
     216$ctrl->label=\'Votre nom\'; 
     217$this->addControl($ctrl);', 
     21817=>'$ctrl= new jFormsControlinput(\'nom\'); 
     219$ctrl->datatype= new jDatatypedate(); 
     220$ctrl->label=\'Votre nom\'; 
     221$this->addControl($ctrl);', 
     22218=>'$ctrl= new jFormsControlinput(\'nom\'); 
     223$ctrl->datatype= new jDatatypetime(); 
     224$ctrl->label=\'Votre nom\'; 
     225$this->addControl($ctrl);', 
     22619=>'$ctrl= new jFormsControlinput(\'nom\'); 
     227$ctrl->datatype= new jDatatypelocaledatetime(); 
     228$ctrl->label=\'Votre nom\'; 
     229$this->addControl($ctrl);', 
     23020=>'$ctrl= new jFormsControlinput(\'nom\'); 
     231$ctrl->datatype= new jDatatypelocaledate(); 
     232$ctrl->label=\'Votre nom\'; 
     233$this->addControl($ctrl);', 
     23421=>'$ctrl= new jFormsControlinput(\'nom\'); 
     235$ctrl->datatype= new jDatatypelocaletime(); 
     236$ctrl->label=\'Votre nom\'; 
     237$this->addControl($ctrl);', 
     23822=>'$ctrl= new jFormsControlinput(\'nom\'); 
     239$ctrl->datatype= new jDatatypeurl(); 
     240$ctrl->label=\'Votre nom\'; 
     241$this->addControl($ctrl);', 
     24223=>'$ctrl= new jFormsControlinput(\'nom\'); 
     243$ctrl->datatype= new jDatatypeemail(); 
     244$ctrl->label=\'Votre nom\'; 
     245$this->addControl($ctrl);', 
     24624=>'$ctrl= new jFormsControlinput(\'nom\'); 
     247$ctrl->datatype= new jDatatypeipv4(); 
     248$ctrl->label=\'Votre nom\'; 
     249$this->addControl($ctrl);', 
     25025=>'$ctrl= new jFormsControlinput(\'nom\'); 
     251$ctrl->datatype= new jDatatypeipv6(); 
    146252$ctrl->label=\'Votre nom\'; 
    147253$this->addControl($ctrl);', 
     
    150256 
    151257    protected $_JsControls = array( 
    152 '$js.="gControl = new jFormsControl(\'nom\', \'Votre nom\', \'string\');\n"; 
    153 $js.="gForm.addControl( gControl);\n";', 
    154 '$js.="gControl = new jFormsControl(\'nom\', \'Votre nom\', \'string\');\n"; 
     2580=>'$js.="gControl = new jFormsControl(\'nom\', \'Votre nom\', \'string\');\n"; 
     259$js.="gForm.addControl( gControl);\n";', 
     2601=>'$js.="gControl = new jFormsControl(\'nom\', \'Votre nom\', \'string\');\n"; 
    155261$js.="gControl.readonly = true;\n"; 
    156262$js.="gForm.addControl( gControl);\n";', 
    157 '$js.="gControl = new jFormsControl(\'nom\', \'Votre nom\', \'string\');\n"; 
     2632=>'$js.="gControl = new jFormsControl(\'nom\', \'Votre nom\', \'string\');\n"; 
    158264$js.="gControl.required = true;\n"; 
    159265$js.="gForm.addControl( gControl);\n";', 
    160 '$js.="gControl = new jFormsControl(\'nom\', \'".str_replace("\'","\\\'",jLocale::get(\'foo~bar\'))."\', \'string\');\n"; 
    161 $js.="gForm.addControl( gControl);\n";', 
    162  
    163  
    164 '$js.="gControl = new jFormsControl(\'nom\', \'Votre nom\', \'string\');\n"; 
    165 $js.="gForm.addControl( gControl);\n";', 
    166  
    167 '$js.="gControl = new jFormsControl(\'nom\', \'Votre nom\', \'string\');\n"; 
    168 $js.="gForm.addControl( gControl);\n";', 
    169  
    170 '$js.="gControl = new jFormsControl(\'nom\', \'Votre nom\', \'string\');\n"; 
    171 $js.="gForm.addControl( gControl);\n";', 
    172  
    173 '$js.="gControl = new jFormsControl(\'nom\', \'Votre nom\', \'string\');\n"; 
    174 $js.="gForm.addControl( gControl);\n";', 
    175  
    176 '$js.="gControl = new jFormsControl(\'nom\', \'Votre nom\', \'string\');\n"; 
    177 $js.="gForm.addControl( gControl);\n";', 
    178  
    179 '$js.="gControl = new jFormsControl(\'nom\', \'Votre nom\', \'string\');\n"; 
    180 $js.="gForm.addControl( gControl);\n";', 
    181  
    182 '$js.="gControl = new jFormsControl(\'nom\', \'Votre nom\', \'string\');\n"; 
    183 $js.="gForm.addControl( gControl);\n";', 
    184  
     2663=>'$js.="gControl = new jFormsControl(\'nom\', \'".str_replace("\'","\\\'",jLocale::get(\'foo~bar\'))."\', \'string\');\n"; 
     267$js.="gForm.addControl( gControl);\n";', 
     268 
     269 
     2704=>'$js.="gControl = new jFormsControl(\'nom\', \'Votre nom\', \'string\');\n"; 
     271$js.="gForm.addControl( gControl);\n";', 
     272 
     2735=>'$js.="gControl = new jFormsControl(\'nom\', \'Votre nom\', \'string\');\n"; 
     274$js.="gForm.addControl( gControl);\n";', 
     275 
     2766=>'$js.="gControl = new jFormsControl(\'nom\', \'Votre nom\', \'string\');\n"; 
     277$js.="gForm.addControl( gControl);\n";', 
     278 
     2797=>'$js.="gControl = new jFormsControl(\'nom\', \'Votre nom\', \'string\');\n"; 
     280$js.="gForm.addControl( gControl);\n";', 
     281 
     2828=>'$js.="gControl = new jFormsControl(\'nom\', \'Votre nom\', \'string\');\n"; 
     283$js.="gForm.addControl( gControl);\n";', 
     284 
     2859=>'$js.="gControl = new jFormsControl(\'nom\', \'Votre nom\', \'string\');\n"; 
     286$js.="gForm.addControl( gControl);\n";', 
     287 
     28810=>'$js.="gControl = new jFormsControl(\'nom\', \'Votre nom\', \'string\');\n"; 
     289$js.="gForm.addControl( gControl);\n";', 
     290 
     29111=>'$js.="gControl = new jFormsControl(\'nom\', \'Votre nom\', \'string\');\n"; 
     292$js.="gForm.addControl( gControl);\n";', 
     29312=>'$js.="gControl = new jFormsControl(\'nom\', \'Votre nom\', \'boolean\');\n"; 
     294$js.="gForm.addControl( gControl);\n";', 
     29513=>'$js.="gControl = new jFormsControl(\'nom\', \'Votre nom\', \'decimal\');\n"; 
     296$js.="gForm.addControl( gControl);\n";', 
     29714=>'$js.="gControl = new jFormsControl(\'nom\', \'Votre nom\', \'integer\');\n"; 
     298$js.="gForm.addControl( gControl);\n";', 
     29915=>'$js.="gControl = new jFormsControl(\'nom\', \'Votre nom\', \'hexadecimal\');\n"; 
     300$js.="gForm.addControl( gControl);\n";', 
     30116=>'$js.="gControl = new jFormsControl(\'nom\', \'Votre nom\', \'datetime\');\n"; 
     302$js.="gForm.addControl( gControl);\n";', 
     30317=>'$js.="gControl = new jFormsControl(\'nom\', \'Votre nom\', \'date\');\n"; 
     304$js.="gForm.addControl( gControl);\n";', 
     30518=>'$js.="gControl = new jFormsControl(\'nom\', \'Votre nom\', \'time\');\n"; 
     306$js.="gForm.addControl( gControl);\n";', 
     30719=>'$js.="gControl = new jFormsControl(\'nom\', \'Votre nom\', \'localedatetime\');\n"; 
     308$js.="gForm.addControl( gControl);\n";', 
     30920=>'$js.="gControl = new jFormsControl(\'nom\', \'Votre nom\', \'localedate\');\n"; 
     310$js.="gForm.addControl( gControl);\n";', 
     31121=>'$js.="gControl = new jFormsControl(\'nom\', \'Votre nom\', \'localetime\');\n"; 
     312$js.="gForm.addControl( gControl);\n";', 
     31322=>'$js.="gControl = new jFormsControl(\'nom\', \'Votre nom\', \'url\');\n"; 
     314$js.="gForm.addControl( gControl);\n";', 
     31523=>'$js.="gControl = new jFormsControl(\'nom\', \'Votre nom\', \'email\');\n"; 
     316$js.="gForm.addControl( gControl);\n";', 
     31724=>'$js.="gControl = new jFormsControl(\'nom\', \'Votre nom\', \'ipv4\');\n"; 
     318$js.="gForm.addControl( gControl);\n";', 
     31925=>'$js.="gControl = new jFormsControl(\'nom\', \'Votre nom\', \'ipv6\');\n"; 
     320$js.="gForm.addControl( gControl);\n";', 
    185321 
    186322    ); 
     
    216352 
    217353 
     354 
     355    protected $_BadXmlControls = array( 
     356array( 
     357'<foo ref="nom" xmlns="http://jelix.org/ns/forms/1.0"> 
     358    <label>Votre nom</label> 
     359</foo>', 
     360'jelix~formserr.unknow.tag', 
     361array('foo','myfile') 
     362), 
     363array( 
     364'<input xmlns="http://jelix.org/ns/forms/1.0"> 
     365    <label>Votre nom</label> 
     366</input>', 
     367'jelix~formserr.attribute.missing', 
     368array('ref','input','myfile') 
     369), 
     370array( 
     371'<textarea ref="nom" type="boolean" xmlns="http://jelix.org/ns/forms/1.0"> 
     372    <label>Votre nom</label> 
     373</textarea>', 
     374'jelix~formserr.attribute.not.allowed', 
     375array('type','textarea','myfile') 
     376), 
     377array( 
     378'<input ref="nom" type="foo" xmlns="http://jelix.org/ns/forms/1.0"> 
     379    <label>Votre nom</label> 
     380</input>', 
     381'jelix~formserr.datatype.unknow', 
     382array('foo','input','myfile') 
     383), 
     384array( 
     385'<input ref="nom" xmlns="http://jelix.org/ns/forms/1.0"> 
     386</input>', 
     387'jelix~formserr.tag.missing', 
     388array('label','input','myfile') 
     389), 
     390/*array( 
     391'<input ref="nom" xmlns="http://jelix.org/ns/forms/1.0"> 
     392    <label>Votre nom</label> 
     393</input>', 
     394'', 
     395array('','','myfile') 
     396),*/ 
     397    ); 
     398 
     399    function testBadControl(){ 
     400        $jfc = new testJFormsCompiler(); 
     401 
     402        foreach($this->_BadXmlControls as $k=>$control){ 
     403            $xml = simplexml_load_string( $control[0]); 
     404            if(!$xml){ 
     405                $this->fail("Can't load bad xml test content ($k)"); 
     406            }else{ 
     407                try { 
     408                    $ct = $jfc->testPhpControl($xml->getName(), $xml); 
     409                    $this->fail("no exception during bad xml test content $k"); 
     410                }catch(jException $e){ 
     411                    $this->assertEqualOrDiff($control[1], $e->getMessage()); 
     412                    $this->assertEqual($control[2], $e->localeParams); 
     413                }catch(Exception $e){ 
     414                    $this->fail("Unexpected exception for bad xml test content $k :". $e->getMessage()); 
     415                } 
     416            } 
     417        } 
     418    } 
    218419} 
    219420 
  • branches/experimental/jforms/testapp/modules/unittest/templates/menu.tpl

    r437 r439  
    44 
    55<p><a href="?">Retour à l'accueil</a></p> 
    6 <h3>Core</h3> 
     6<ul> 
     7<li>core 
    78<ul> 
    89    <li><a href="?module=unittest&amp;action=default_testselectormod">selecteurs normaux</a></li> <!--{jurl 'unittest~testselectormod'} --> 
     
    2021</li>{/if} 
    2122</ul> 
    22  
    23 <h3>jEvent</h3> 
     23</li> 
     24<li>jEvent 
    2425<ul> 
    2526    <li><a href="?module=unittest&amp;action=testevent">lancer deux évènements</a></li> 
    2627</ul> 
     28</li> 
    2729 
    28 <h3>jUrl</h3> 
     30<li>jUrl 
    2931<ul> 
    3032    <li><a href="?module=unittest&amp;action=testurlcreate">Tester la création d'url</a></li> 
    3133    <li><a href="?module=unittest&amp;action=testurlparse">Tester l'analyse d'url</a></li> 
    3234</ul> 
     35</li> 
    3336 
    34 <h3>jTpl</h3> 
     37<li>jTpl 
    3538<ul> 
    3639    <li><a href="?module=unittest&amp;action=tpl_parseExpression">expressions</a></li> 
    3740</ul> 
     41</li> 
    3842 
    39 <h3>jDao</h3> 
     43<li>jDao 
    4044<ul> 
    4145    <li><a href="?module=unittest&amp;action=dao_parser">Parser</a></li> 
     
    4347    <li><a href="?module=unittest&amp;action=dao_conditions">jDaoConditions</a></li> 
    4448</ul> 
    45 <h3>jAcl</h3> 
     49</li> 
     50<li>jAcl 
    4651<ul> 
    4752    <li><a href="?module=unittest&amp;action=acl_usergroup">jAclUserGroup</a></li> 
     
    4954    <li><a href="?module=unittest&amp;action=acl_index">jAcl</a></li> 
    5055</ul> 
     56</li> 
    5157 
    52 <h3>jForms</h3> 
     58<li>jForms 
    5359<ul> 
    5460    <li><a href="?module=unittest&amp;action=jforms_parseControls">compilateur</a></li> 
    5561</ul> 
     62</li> 
    5663 
    57  
    58 <h3>Utilitaires</h3> 
     64<li>Utilitaires 
    5965<ul> 
    6066    <li><a href="?module=unittest&amp;action=testfilter">jFilter</a></li> 
    6167</ul> 
     68</li> 
     69</ul> 
Download in other formats: Unified Diff Zip Archive