Ignore:
Timestamp:
12/08/08 05:12:51 (3 years ago)
Author:
ArthurClemens
Message:

Item113: fix couple of unit tests

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/UnitTestContrib/test/unit/InitFormTests.pm

    r1178 r1209  
    200200    my $text = setup_formtests( $this, $testweb, $testtopic1, "formtemplate=\"$testweb.$testform\"" ); 
    201201 
    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"> 
     204Simple 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)); 
    206206    $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)); 
    210210} 
    211211 
     
    216216    my $text = setup_formtests( $this, $testweb, $testtopic1, "formtemplate=\"$testweb.$testform\" templatetopic=\"$testweb.$testtmpl\"" ); 
    217217 
    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"> 
     220Simple 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)); 
    222222    $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)); 
    226226 
    227227} 
     
    233233    my $text = setup_formtests( $this, $testweb, "${testtopic1}XXXXXXXXXX", "formtemplate=\"$testweb.$testform\" templatetopic=\"$testweb.$testtmpl\"" ); 
    234234 
    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)); 
    236236    $this->assert_html_matches('<textarea name="IssueDescription"  rows="5" cols="55" class="foswikiTextarea"> 
    237237---+ 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)); 
    239239    $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)); 
    241241    $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)); 
    243243 
    244244} 
     
    250250    my $text = setup_formtests( $this, $testweb, "$testtopic2", "formtemplate=\"$testweb.$testform\" templatetopic=\"$testweb.$testtmpl\"" ); 
    251251 
    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)); 
    253253    $this->assert_html_matches('<textarea name="IssueDescription"  rows="5" cols="55" class="foswikiTextarea"> 
    254254---+ 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)); 
    256256    $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)); 
    258258    $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)); 
    260260 
    261261} 
     
    267267    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%\" " ); 
    268268 
    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)); 
    270270    $this->assert_html_matches('<textarea name="IssueDescription"  rows="5" cols="55" class="foswikiTextarea"> 
    271271---+ 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)); 
    273273    $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)); 
    275275    $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)); 
    277277 
    278278} 
     
    284284    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%\" " ); 
    285285 
    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"> 
     288Simple 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)); 
    290290    $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)); 
    294294 
    295295} 
     
    301301    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%\" " ); 
    302302 
    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"> 
     305Simple 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)); 
    307307    $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)); 
    311311 
    312312} 
     
    318318    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=\"\"" ); 
    319319 
    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"> 
     322Simple 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)); 
    324324    $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)); 
    328328 
    329329} 
     
    339339    my $text = setup_formtests( $this, $testweb, $testtopic3 ); 
    340340 
    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)); 
    342342    $this->assert_html_matches('<textarea name="IssueDescription"  rows="5" cols="55" class="foswikiTextarea"> 
    343343Simple description of problem</textarea>', get_formfield(2, $text)); 
    344344    #  $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)); 
    346346    $this->assert_html_matches('<input type="hidden" name="History1" value="%SCRIPTURL%"  />', get_formfield(4, $text)); 
    347347    $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.