Changeset 9495
- Timestamp:
- 06/09/08 15:41:42 (2 years ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/1.1/lib/plugins/sfCompat10Plugin/test/unit/util/sfFillInFormTest.php
r9219 r9495 12 12 require_once(dirname(__FILE__).'/../../../lib/util/sfFillInForm.class.php'); 13 13 14 $t = new lime_test( 69, new lime_output_color());14 $t = new lime_test(72, new lime_output_color()); 15 15 16 16 $html = <<<EOF … … 258 258 <form action="#" method="post" name="form"> 259 259 <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> 260 265 </form> 261 266 </body> … … 264 269 $xml = $f->fillInXml($xml, 'form', null, array('foo' => 'bar')); 265 270 $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'); 266 272 $t->like($xml, '#<\?xml version="1.0"\?>#', '->fillInXml() outputs XML prolog'); 267 273 268 274 // ->fillInXhtml() 269 275 $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'); 271 278 $t->unlike($xml, '#<\?xml version="1.0"\?>#', '->fillInXhtml() does not output XML prolog'); 272 279 … … 280 287 <form action="#" method="post" name="form"> 281 288 <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> 282 294 </form> 283 295 </body> … … 286 298 $xml = $f->fillInHtml($xml, 'form', null, array('foo' => 'bar')); 287 299 $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'); 288 301 289 302 $xml = <<<EOF … … 298 311 EOF; 299 312 $xml = $f->fillInHtml($xml, 'form', null, array('foo' => 'bar')); 300 $t->like($xml, '#<input type="text" name="foo" value="bar">#', '->fillInHtml() outputs valid HTML ');313 $t->like($xml, '#<input type="text" name="foo" value="bar">#', '->fillInHtml() outputs valid HTML with doctype'); 301 314 $t->unlike($xml, '#<head.*?>#', '->fillInHtml() outputs valid HTML doesnt add head when not in input'); 302 315 $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');

