Changeset 10982
- Timestamp:
- 08/20/08 08:55:37 (11 months ago)
- Files:
-
- branches/1.2/lib/form/sfFormField.class.php (modified) (5 diffs)
- branches/1.2/test/unit/form/sfFormFieldTest.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/1.2/lib/form/sfFormField.class.php
r10440 r10982 4 4 * This file is part of the symfony package. 5 5 * (c) Fabien Potencier <fabien.potencier@symfony-project.com> 6 * 6 * 7 7 * For the full copyright and license information, please view the LICENSE 8 8 * file that was distributed with this source code. … … 21 21 protected static 22 22 $toStringException = null; 23 23 24 24 protected 25 25 $widget = null, … … 66 66 } 67 67 } 68 68 69 69 /** 70 70 * Returns true if a form thrown an exception in the __toString() method … … 90 90 return self::$toStringException; 91 91 } 92 92 93 93 /** 94 94 * Sets an exception thrown by the __toString() method. … … 223 223 224 224 /** 225 * Returns the widget name. 226 * 227 * @return mixed The widget name 228 */ 229 public function getName() 230 { 231 return $this->name; 232 } 233 234 /** 225 235 * Returns the widget value. 226 236 * branches/1.2/test/unit/form/sfFormFieldTest.php
r9238 r10982 11 11 require_once(dirname(__FILE__).'/../../bootstrap/unit.php'); 12 12 13 $t = new lime_test(2 5, new lime_output_color());13 $t = new lime_test(26, new lime_output_color()); 14 14 15 15 // widgets … … 39 39 40 40 // ->getValue() ->getWidget() ->getParent() ->getError() ->hasError() 41 $t->diag('->getValue() ->get Widget() ->getParent() ->getError() ->hasError()');41 $t->diag('->getValue() ->getName() ->getWidget() ->getParent() ->getError() ->hasError()'); 42 42 $t->ok($f->getWidget() == $titleWidget, '->getWidget() returns the form field widget'); 43 $t->is($f->getName(), 'title', '->getName() returns the form field name'); 43 44 $t->is($f->getValue(), 'symfony', '->getValue() returns the form field value'); 44 45 $t->is($f->getParent(), $parent, '->getParent() returns the form field parent'); … … 215 216 EOF; 216 217 $t->is($child->renderError(), $output, '->renderError() renders global errors as expected (global errors, hidden field errors, non existent field errors)'); 217

