Changeset 1209 for trunk/UnitTestContrib/test/unit/InitFormTests.pm
- Timestamp:
- 12/08/08 05:12:51 (3 years ago)
- File:
-
- 1 edited
-
trunk/UnitTestContrib/test/unit/InitFormTests.pm (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/UnitTestContrib/test/unit/InitFormTests.pm
r1178 r1209 200 200 my $text = setup_formtests( $this, $testweb, $testtopic1, "formtemplate=\"$testweb.$testform\"" ); 201 201 202 $this->assert_html_matches('<input type="text" name="IssueName" value="My first defect" size="73" class=" twikiInputField twikiMandatory" />', get_formfield(1, $text));203 $this->assert_html_matches('<textarea name="IssueDescription" rows="5" cols="55" class="foswikiTextarea"> 204 Simple description of problem</textarea>', get_formfield(2, $text)); 205 $this->assert_html_matches('<select name="IssueType" class=" twikiSelect twikiEditFormSelect" size="1"><option class="twikiEditFormOption">Defect</option><option class="twikiEditFormOption">Enhancement</option><option class="twikiEditFormOption">Other</option></select>', get_formfield(3, $text));202 $this->assert_html_matches('<input type="text" name="IssueName" value="My first defect" size="73" class="foswikiInputField foswikiMandatory" />', get_formfield(1, $text)); 203 $this->assert_html_matches('<textarea name="IssueDescription" rows="5" cols="55" class="foswikiTextarea"> 204 Simple description of problem</textarea>', get_formfield(2, $text)); 205 $this->assert_html_matches('<select name="IssueType" class="foswikiSelect" size="1"><option class="foswikiOption">Defect</option><option class="foswikiOption">Enhancement</option><option class="foswikiOption">Other</option></select>', get_formfield(3, $text)); 206 206 $this->assert_html_matches('<input type="hidden" name="History1" value="' . $aurl . '" />', get_formfield(4, $text)); 207 $this->assert_html_matches('<input type="text" name="History2" value="' . $aurl . '" size="20" class=" twikiInputField" />', get_formfield(5, $text));208 $this->assert_html_matches('<input type="hidden" name="History3" value="%ATTACHURL%" />', get_formfield(6, $text)); 209 $this->assert_html_matches('<input type="text" name="History4" value="%ATTACHURL%" size="20" class=" twikiInputField" />', get_formfield(7, $text));207 $this->assert_html_matches('<input type="text" name="History2" value="' . $aurl . '" size="20" class="foswikiInputField" />', get_formfield(5, $text)); 208 $this->assert_html_matches('<input type="hidden" name="History3" value="%ATTACHURL%" />', get_formfield(6, $text)); 209 $this->assert_html_matches('<input type="text" name="History4" value="%ATTACHURL%" size="20" class="foswikiInputField" />', get_formfield(7, $text)); 210 210 } 211 211 … … 216 216 my $text = setup_formtests( $this, $testweb, $testtopic1, "formtemplate=\"$testweb.$testform\" templatetopic=\"$testweb.$testtmpl\"" ); 217 217 218 $this->assert_html_matches('<input type="text" name="IssueName" value="My first defect" size="73" class=" twikiInputField twikiMandatory" />', get_formfield(1, $text));219 $this->assert_html_matches('<textarea name="IssueDescription" rows="5" cols="55" class="foswikiTextarea"> 220 Simple description of problem</textarea>', get_formfield(2, $text)); 221 $this->assert_html_matches('<select name="IssueType" class=" twikiSelect twikiEditFormSelect" size="1"><option class="twikiEditFormOption">Defect</option><option class="twikiEditFormOption">Enhancement</option><option class="twikiEditFormOption">Other</option></select>', get_formfield(3, $text));218 $this->assert_html_matches('<input type="text" name="IssueName" value="My first defect" size="73" class="foswikiInputField foswikiMandatory" />', get_formfield(1, $text)); 219 $this->assert_html_matches('<textarea name="IssueDescription" rows="5" cols="55" class="foswikiTextarea"> 220 Simple description of problem</textarea>', get_formfield(2, $text)); 221 $this->assert_html_matches('<select name="IssueType" class="foswikiSelect" size="1"><option class="foswikiOption">Defect</option><option class="foswikiOption">Enhancement</option><option class="foswikiOption">Other</option></select>', get_formfield(3, $text)); 222 222 $this->assert_html_matches('<input type="hidden" name="History1" value="' . $aurl . '" />', get_formfield(4, $text)); 223 $this->assert_html_matches('<input type="text" name="History2" value="' . $aurl . '" size="20" class=" twikiInputField" />', get_formfield(5, $text));224 $this->assert_html_matches('<input type="hidden" name="History3" value="%ATTACHURL%" />', get_formfield(6, $text)); 225 $this->assert_html_matches('<input type="text" name="History4" value="%ATTACHURL%" size="20" class=" twikiInputField" />', get_formfield(7, $text));223 $this->assert_html_matches('<input type="text" name="History2" value="' . $aurl . '" size="20" class="foswikiInputField" />', get_formfield(5, $text)); 224 $this->assert_html_matches('<input type="hidden" name="History3" value="%ATTACHURL%" />', get_formfield(6, $text)); 225 $this->assert_html_matches('<input type="text" name="History4" value="%ATTACHURL%" size="20" class="foswikiInputField" />', get_formfield(7, $text)); 226 226 227 227 } … … 233 233 my $text = setup_formtests( $this, $testweb, "${testtopic1}XXXXXXXXXX", "formtemplate=\"$testweb.$testform\" templatetopic=\"$testweb.$testtmpl\"" ); 234 234 235 $this->assert_html_matches('<input type="text" name="IssueName" value="_An issue_" size="73" class=" twikiInputField twikiMandatory" />', get_formfield(1, $text));235 $this->assert_html_matches('<input type="text" name="IssueName" value="_An issue_" size="73" class="foswikiInputField foswikiMandatory" />', get_formfield(1, $text)); 236 236 $this->assert_html_matches('<textarea name="IssueDescription" rows="5" cols="55" class="foswikiTextarea"> 237 237 ---+ Example problem</textarea>', get_formfield(2, $text)); 238 $this->assert_html_matches('<select name="IssueType" class=" twikiSelect twikiEditFormSelect" size="1"><option class="twikiEditFormOption" selected="selected">Defect</option><option class="twikiEditFormOption">Enhancement</option><option class="twikiEditFormOption">Other</option></select>', get_formfield(3, $text));238 $this->assert_html_matches('<select name="IssueType" class="foswikiSelect" size="1"><option class="foswikiOption" selected="selected">Defect</option><option class="foswikiOption">Enhancement</option><option class="foswikiOption">Other</option></select>', get_formfield(3, $text)); 239 239 $this->assert_html_matches('<input type="hidden" name="History1" value="%SCRIPTURL%" />', get_formfield(4, $text)); 240 $this->assert_html_matches('<input type="text" name="History2" value="%SCRIPTURL%" size="20" class=" twikiInputField" />', get_formfield(5, $text));240 $this->assert_html_matches('<input type="text" name="History2" value="%SCRIPTURL%" size="20" class="foswikiInputField" />', get_formfield(5, $text)); 241 241 $this->assert_html_matches('<input type="hidden" name="History3" value="%SCRIPTURL%" />', get_formfield(6, $text)); 242 $this->assert_html_matches('<input type="text" name="History4" value="%SCRIPTURL%" size="20" class=" twikiInputField" />', get_formfield(7, $text));242 $this->assert_html_matches('<input type="text" name="History4" value="%SCRIPTURL%" size="20" class="foswikiInputField" />', get_formfield(7, $text)); 243 243 244 244 } … … 250 250 my $text = setup_formtests( $this, $testweb, "$testtopic2", "formtemplate=\"$testweb.$testform\" templatetopic=\"$testweb.$testtmpl\"" ); 251 251 252 $this->assert_html_matches('<input type="text" name="IssueName" value="_An issue_" size="73" class=" twikiInputField twikiMandatory" />', get_formfield(1, $text));252 $this->assert_html_matches('<input type="text" name="IssueName" value="_An issue_" size="73" class="foswikiInputField foswikiMandatory" />', get_formfield(1, $text)); 253 253 $this->assert_html_matches('<textarea name="IssueDescription" rows="5" cols="55" class="foswikiTextarea"> 254 254 ---+ Example problem</textarea>', get_formfield(2, $text)); 255 $this->assert_html_matches('<select name="IssueType" class=" twikiSelect twikiEditFormSelect" size="1"><option class="twikiEditFormOption" selected="selected">Defect</option><option class="twikiEditFormOption">Enhancement</option><option class="twikiEditFormOption">Other</option></select>', get_formfield(3, $text));255 $this->assert_html_matches('<select name="IssueType" class="foswikiSelect" size="1"><option class="foswikiOption" selected="selected">Defect</option><option class="foswikiOption">Enhancement</option><option class="foswikiOption">Other</option></select>', get_formfield(3, $text)); 256 256 $this->assert_html_matches('<input type="hidden" name="History1" value="%SCRIPTURL%" />', get_formfield(4, $text)); 257 $this->assert_html_matches('<input type="text" name="History2" value="%SCRIPTURL%" size="20" class=" twikiInputField" />', get_formfield(5, $text));257 $this->assert_html_matches('<input type="text" name="History2" value="%SCRIPTURL%" size="20" class="foswikiInputField" />', get_formfield(5, $text)); 258 258 $this->assert_html_matches('<input type="hidden" name="History3" value="%SCRIPTURL%" />', get_formfield(6, $text)); 259 $this->assert_html_matches('<input type="text" name="History4" value="%SCRIPTURL%" size="20" class=" twikiInputField" />', get_formfield(7, $text));259 $this->assert_html_matches('<input type="text" name="History4" value="%SCRIPTURL%" size="20" class="foswikiInputField" />', get_formfield(7, $text)); 260 260 261 261 } … … 267 267 my $text = setup_formtests( $this, $testweb, "$testtopic1", "formtemplate=\"$testweb.$testform\" templatetopic=\"$testweb.$testtmpl\" IssueName=\"_An issue_\" IssueDescription=\"---+ Example problem\" IssueType=\"Defect\" History1=\"%SCRIPTURL%\" History2=\"%SCRIPTURL%\" History3=\"\$percntSCRIPTURL%\" History4=\"\$percntSCRIPTURL%\" " ); 268 268 269 $this->assert_html_matches('<input type="text" name="IssueName" value="_An issue_" size="73" class=" twikiInputField twikiMandatory" />', get_formfield(1, $text));269 $this->assert_html_matches('<input type="text" name="IssueName" value="_An issue_" size="73" class="foswikiInputField foswikiMandatory" />', get_formfield(1, $text)); 270 270 $this->assert_html_matches('<textarea name="IssueDescription" rows="5" cols="55" class="foswikiTextarea"> 271 271 ---+ Example problem</textarea>', get_formfield(2, $text)); 272 $this->assert_html_matches('<select name="IssueType" class=" twikiSelect twikiEditFormSelect" size="1"><option class="twikiEditFormOption" selected="selected">Defect</option><option class="twikiEditFormOption">Enhancement</option><option class="twikiEditFormOption">Other</option></select>', get_formfield(3, $text));272 $this->assert_html_matches('<select name="IssueType" class="foswikiSelect" size="1"><option class="foswikiOption" selected="selected">Defect</option><option class="foswikiOption">Enhancement</option><option class="foswikiOption">Other</option></select>', get_formfield(3, $text)); 273 273 $this->assert_html_matches('<input type="hidden" name="History1" value="%SCRIPTURL%" />', get_formfield(4, $text)); 274 $this->assert_html_matches('<input type="text" name="History2" value="%SCRIPTURL%" size="20" class=" twikiInputField" />', get_formfield(5, $text));274 $this->assert_html_matches('<input type="text" name="History2" value="%SCRIPTURL%" size="20" class="foswikiInputField" />', get_formfield(5, $text)); 275 275 $this->assert_html_matches('<input type="hidden" name="History3" value="%SCRIPTURL%" />', get_formfield(6, $text)); 276 $this->assert_html_matches('<input type="text" name="History4" value="%SCRIPTURL%" size="20" class=" twikiInputField" />', get_formfield(7, $text));276 $this->assert_html_matches('<input type="text" name="History4" value="%SCRIPTURL%" size="20" class="foswikiInputField" />', get_formfield(7, $text)); 277 277 278 278 } … … 284 284 my $text = setup_formtests( $this, $testweb, "$testtopic2", "formtemplate=\"$testweb.$testform\" templatetopic=\"$testweb.$testtmpl\" IssueName=\"My first defect\" IssueDescription=\"Simple description of problem\" IssueType=\"Enhancement\" History1=\"%ATTACHURL%\" History2=\"%ATTACHURL%\" History3=\"\$percntATTACHURL%\" History4=\"\$percntATTACHURL%\" " ); 285 285 286 $this->assert_html_matches('<input type="text" name="IssueName" value="My first defect" size="73" class=" twikiInputField twikiMandatory" />', get_formfield(1, $text));287 $this->assert_html_matches('<textarea name="IssueDescription" rows="5" cols="55" class="foswikiTextarea"> 288 Simple description of problem</textarea>', get_formfield(2, $text)); 289 $this->assert_html_matches('<select name="IssueType" class=" twikiSelect twikiEditFormSelect" size="1"><option class="twikiEditFormOption">Defect</option><option class="twikiEditFormOption" selected="selected">Enhancement</option><option class="twikiEditFormOption">Other</option></select>', get_formfield(3, $text));286 $this->assert_html_matches('<input type="text" name="IssueName" value="My first defect" size="73" class="foswikiInputField foswikiMandatory" />', get_formfield(1, $text)); 287 $this->assert_html_matches('<textarea name="IssueDescription" rows="5" cols="55" class="foswikiTextarea"> 288 Simple description of problem</textarea>', get_formfield(2, $text)); 289 $this->assert_html_matches('<select name="IssueType" class="foswikiSelect" size="1"><option class="foswikiOption">Defect</option><option class="foswikiOption" selected="selected">Enhancement</option><option class="foswikiOption">Other</option></select>', get_formfield(3, $text)); 290 290 $this->assert_html_matches('<input type="hidden" name="History1" value="%ATTACHURL%" />', get_formfield(4, $text)); 291 $this->assert_html_matches('<input type="text" name="History2" value="%ATTACHURL%" size="20" class=" twikiInputField" />', get_formfield(5, $text));292 $this->assert_html_matches('<input type="hidden" name="History3" value="%ATTACHURL%" />', get_formfield(6, $text)); 293 $this->assert_html_matches('<input type="text" name="History4" value="%ATTACHURL%" size="20" class=" twikiInputField" />', get_formfield(7, $text));291 $this->assert_html_matches('<input type="text" name="History2" value="%ATTACHURL%" size="20" class="foswikiInputField" />', get_formfield(5, $text)); 292 $this->assert_html_matches('<input type="hidden" name="History3" value="%ATTACHURL%" />', get_formfield(6, $text)); 293 $this->assert_html_matches('<input type="text" name="History4" value="%ATTACHURL%" size="20" class="foswikiInputField" />', get_formfield(7, $text)); 294 294 295 295 } … … 301 301 my $text = setup_formtests( $this, $testweb, "${testtopic1}XXXXXXXXXX", "formtemplate=\"$testweb.$testform\" templatetopic=\"$testweb.$testtmpl\" IssueName=\"My first defect\" IssueDescription=\"Simple description of problem\" IssueType=\"Enhancement\" History1=\"%ATTACHURL%\" History2=\"%ATTACHURL%\" History3=\"\$percntATTACHURL%\" History4=\"\$percntATTACHURL%\" " ); 302 302 303 $this->assert_html_matches('<input type="text" name="IssueName" value="My first defect" size="73" class=" twikiInputField twikiMandatory" />', get_formfield(1, $text));304 $this->assert_html_matches('<textarea name="IssueDescription" rows="5" cols="55" class="foswikiTextarea"> 305 Simple description of problem</textarea>', get_formfield(2, $text)); 306 $this->assert_html_matches('<select name="IssueType" class=" twikiSelect twikiEditFormSelect" size="1"><option class="twikiEditFormOption">Defect</option><option class="twikiEditFormOption" selected="selected">Enhancement</option><option class="twikiEditFormOption">Other</option></select>', get_formfield(3, $text));303 $this->assert_html_matches('<input type="text" name="IssueName" value="My first defect" size="73" class="foswikiInputField foswikiMandatory" />', get_formfield(1, $text)); 304 $this->assert_html_matches('<textarea name="IssueDescription" rows="5" cols="55" class="foswikiTextarea"> 305 Simple description of problem</textarea>', get_formfield(2, $text)); 306 $this->assert_html_matches('<select name="IssueType" class="foswikiSelect" size="1"><option class="foswikiOption">Defect</option><option class="foswikiOption" selected="selected">Enhancement</option><option class="foswikiOption">Other</option></select>', get_formfield(3, $text)); 307 307 $this->assert_html_matches('<input type="hidden" name="History1" value="%ATTACHURL%" />', get_formfield(4, $text)); 308 $this->assert_html_matches('<input type="text" name="History2" value="%ATTACHURL%" size="20" class=" twikiInputField" />', get_formfield(5, $text));309 $this->assert_html_matches('<input type="hidden" name="History3" value="%ATTACHURL%" />', get_formfield(6, $text)); 310 $this->assert_html_matches('<input type="text" name="History4" value="%ATTACHURL%" size="20" class=" twikiInputField" />', get_formfield(7, $text));308 $this->assert_html_matches('<input type="text" name="History2" value="%ATTACHURL%" size="20" class="foswikiInputField" />', get_formfield(5, $text)); 309 $this->assert_html_matches('<input type="hidden" name="History3" value="%ATTACHURL%" />', get_formfield(6, $text)); 310 $this->assert_html_matches('<input type="text" name="History4" value="%ATTACHURL%" size="20" class="foswikiInputField" />', get_formfield(7, $text)); 311 311 312 312 } … … 318 318 my $text = setup_formtests( $this, $testweb, $testtopic1, "formtemplate=\"$testweb.$testform\" templatetopic=\"$testweb.$testtmpl\" IssueName=\"My first defect\" IssueDescription=\"Simple description of problem\" IssueType=\"Enhancement\" History1=\"%ATTACHURL%\" History2=\"%ATTACHURL%\" History3=\"\$percntATTACHURL%\" History4=\"\$percntATTACHURL%\" text=\"\"" ); 319 319 320 $this->assert_html_matches('<input type="text" name="IssueName" value="My first defect" size="73" class=" twikiInputField twikiMandatory" />', get_formfield(1, $text));321 $this->assert_html_matches('<textarea name="IssueDescription" rows="5" cols="55" class="foswikiTextarea"> 322 Simple description of problem</textarea>', get_formfield(2, $text)); 323 $this->assert_html_matches('<select name="IssueType" class=" twikiSelect twikiEditFormSelect" size="1"><option class="twikiEditFormOption">Defect</option><option class="twikiEditFormOption" selected="selected">Enhancement</option><option class="twikiEditFormOption">Other</option></select>', get_formfield(3, $text));320 $this->assert_html_matches('<input type="text" name="IssueName" value="My first defect" size="73" class="foswikiInputField foswikiMandatory" />', get_formfield(1, $text)); 321 $this->assert_html_matches('<textarea name="IssueDescription" rows="5" cols="55" class="foswikiTextarea"> 322 Simple description of problem</textarea>', get_formfield(2, $text)); 323 $this->assert_html_matches('<select name="IssueType" class="foswikiSelect" size="1"><option class="foswikiOption">Defect</option><option class="foswikiOption" selected="selected">Enhancement</option><option class="foswikiOption">Other</option></select>', get_formfield(3, $text)); 324 324 $this->assert_html_matches('<input type="hidden" name="History1" value="%ATTACHURL%" />', get_formfield(4, $text)); 325 $this->assert_html_matches('<input type="text" name="History2" value="%ATTACHURL%" size="20" class=" twikiInputField" />', get_formfield(5, $text));326 $this->assert_html_matches('<input type="hidden" name="History3" value="%ATTACHURL%" />', get_formfield(6, $text)); 327 $this->assert_html_matches('<input type="text" name="History4" value="%ATTACHURL%" size="20" class=" twikiInputField" />', get_formfield(7, $text));325 $this->assert_html_matches('<input type="text" name="History2" value="%ATTACHURL%" size="20" class="foswikiInputField" />', get_formfield(5, $text)); 326 $this->assert_html_matches('<input type="hidden" name="History3" value="%ATTACHURL%" />', get_formfield(6, $text)); 327 $this->assert_html_matches('<input type="text" name="History4" value="%ATTACHURL%" size="20" class="foswikiInputField" />', get_formfield(7, $text)); 328 328 329 329 } … … 339 339 my $text = setup_formtests( $this, $testweb, $testtopic3 ); 340 340 341 $this->assert_html_matches('<input type="text" name="IssueName" value="My first defect" size="73" class=" twikiInputField twikiMandatory" />', get_formfield(1, $text));341 $this->assert_html_matches('<input type="text" name="IssueName" value="My first defect" size="73" class="foswikiInputField foswikiMandatory" />', get_formfield(1, $text)); 342 342 $this->assert_html_matches('<textarea name="IssueDescription" rows="5" cols="55" class="foswikiTextarea"> 343 343 Simple description of problem</textarea>', get_formfield(2, $text)); 344 344 # $this->assert_matches(qr/<select [^>]+><option ([^>]+| selected)>Defect<\/option>/, get_formfield(3, $text)); 345 $this->assert_html_matches('<select name="IssueType" class=" twikiSelect twikiEditFormSelect" size="1"><option class="twikiEditFormOption" selected="selected">Defect</option><option class="twikiEditFormOption">Enhancement</option><option class="twikiEditFormOption">Other</option></select>', get_formfield(3, $text));345 $this->assert_html_matches('<select name="IssueType" class="foswikiSelect" size="1"><option class="foswikiOption" selected="selected">Defect</option><option class="foswikiOption">Enhancement</option><option class="foswikiOption">Other</option></select>', get_formfield(3, $text)); 346 346 $this->assert_html_matches('<input type="hidden" name="History1" value="%SCRIPTURL%" />', get_formfield(4, $text)); 347 347 $this->assert_html_matches('<input type="hidden" name="History3" value="$percntSCRIPTURL%" />', get_formfield(6, $text));
Note: See TracChangeset
for help on using the changeset viewer.
