Changeset 7154
- Timestamp:
- 01/22/08 15:32:58 (10 months ago)
- Files:
-
- branches/1.1/lib/form/sfForm.class.php (modified) (1 diff)
- branches/1.1/test/unit/form/sfFormTest.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/1.1/lib/form/sfForm.class.php
r7152 r7154 113 113 public function renderGlobalErrors() 114 114 { 115 return $this->widgetSchema->getFormFormatter()->formatError Row($this->widgetSchema->getGlobalErrors($this->getErrorSchema()));115 return $this->widgetSchema->getFormFormatter()->formatErrorsForRow($this->widgetSchema->getGlobalErrors($this->getErrorSchema())); 116 116 } 117 117 branches/1.1/test/unit/form/sfFormTest.php
r7124 r7154 11 11 require_once(dirname(__FILE__).'/../../bootstrap/unit.php'); 12 12 13 $t = new lime_test(8 4, new lime_output_color());13 $t = new lime_test(85, new lime_output_color()); 14 14 15 15 class FormTest extends sfForm … … 221 221 $t->is($f->getErrorSchema()->getCode(), '1 [min_length] file [max_size]', '->bind() behaves correctly with files'); 222 222 223 // ->renderGlobalErrors() 224 $t->diag('->renderGlobalErrors()'); 225 $f = new FormTest(); 226 $f->setValidatorSchema(new sfValidatorSchema(array( 227 'id' => new sfValidatorInteger(), 228 'first_name' => new sfValidatorString(array('min_length' => 2)), 229 'last_name' => new sfValidatorString(array('min_length' => 2)), 230 ))); 231 $f->setWidgetSchema(new sfWidgetFormSchema(array( 232 'id' => new sfWidgetFormInputHidden(), 233 'first_name' => new sfWidgetFormInput(), 234 'last_name' => new sfWidgetFormInput(), 235 ))); 236 $f->bind(array( 237 'id' => 'dddd', 238 'first_name' => 'f', 239 'last_name' => 'potencier', 240 )); 241 $output = <<<EOF 242 <ul class="error_list"> 243 <li>Id: "dddd" is not an integer.</li> 244 </ul> 245 246 EOF; 247 $t->is($f->renderGlobalErrors(), $output, '->renderGlobalErrors() renders global errors as an HTML list'); 248 223 249 // ->embedForm() 224 250 $t->diag('->embedForm()');