Development

Changeset 9494

You must first sign up to be able to contribute.

Changeset 9494

Show
Ignore:
Timestamp:
06/09/08 15:41:30 (3 months ago)
Author:
FabianLange
Message:

added more fillin tests. refs #3707

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/1.0/test/unit/util/sfFillInFormTest.php

    r9218 r9494  
    1212require_once($_test_dir.'/../lib/util/sfFillInForm.class.php'); 
    1313 
    14 $t = new lime_test(69, new lime_output_color()); 
     14$t = new lime_test(72, new lime_output_color()); 
    1515 
    1616$html = <<<EOF 
     
    258258    <form action="#" method="post" name="form"> 
    259259      <input type="text" name="foo" /> 
     260      <select name="select"> 
     261        <option value="first">first</option> 
     262        <option value="selected" selected="selected">selected</option> 
     263        <option value="last">last</option> 
     264      </select> 
    260265    </form> 
    261266  </body> 
     
    264269$xml = $f->fillInXml($xml, 'form', null, array('foo' => 'bar')); 
    265270$t->like($xml, '#<input type="text" name="foo" value="bar"\s*/>#', '->fillInXml() outputs valid XML'); 
     271$t->like($xml, '#<option value="selected" selected="selected">#', '->fillInXml() outputs valid XML'); 
    266272$t->like($xml, '#<\?xml version="1.0"\?>#',  '->fillInXml() outputs XML prolog'); 
    267273 
    268274// ->fillInXhtml() 
    269275$xml = $f->fillInXhtml($xml, 'form', null, array('foo' => 'bar')); 
    270 $t->like($xml, '#<input type="text" name="foo" value="bar"\s*/>#', '->fillInXml() outputs valid XML'); 
     276$t->like($xml, '#<input type="text" name="foo" value="bar"\s*/>#', '->fillInXhml() outputs valid XML'); 
     277$t->like($xml, '#<option value="selected" selected="selected">#', '->fillInXhml() outputs valid XML'); 
    271278$t->unlike($xml, '#<\?xml version="1.0"\?>#',  '->fillInXhtml() does not output XML prolog'); 
    272279 
     
    280287    <form action="#" method="post" name="form"> 
    281288      <input type="text" name="foo"> 
     289      <select name="select"> 
     290        <option value="first">first</option> 
     291        <option value="selected" selected="selected">selected</option> 
     292        <option value="last">last</option> 
     293      </select> 
    282294    </form> 
    283295  </body> 
     
    286298$xml = $f->fillInHtml($xml, 'form', null, array('foo' => 'bar')); 
    287299$t->like($xml, '#<input type="text" name="foo" value="bar">#', '->fillInHtml() outputs valid HTML'); 
     300$t->like($xml, '#<option value="selected" selected>#', '->fillInHtml() outputs valid HTML'); 
    288301 
    289302$xml = <<<EOF 
     
    298311EOF; 
    299312$xml = $f->fillInHtml($xml, 'form', null, array('foo' => 'bar')); 
    300 $t->like($xml, '#<input type="text" name="foo" value="bar">#', '->fillInHtml() outputs valid HTML width doctype'); 
     313$t->like($xml, '#<input type="text" name="foo" value="bar">#', '->fillInHtml() outputs valid HTML with doctype'); 
    301314$t->unlike($xml, '#<head.*?>#', '->fillInHtml() outputs valid HTML doesnt add head when not in input'); 
    302315$t->unlike($xml, '#<meta http-equiv="Content-Type" content="text/html; charset=utf-8">#', '->fillInHtml() outputs valid HTML doesnt add meta when not in input');