Changeset 24278
- Timestamp:
- 11/23/09 16:21:09 (3 years ago)
- Files:
-
- branches/1.3/lib/form/sfForm.class.php (modified) (1 diff)
- branches/1.3/test/unit/form/sfFormTest.php (modified) (3 diffs)
- branches/1.4/lib/form/sfForm.class.php (modified) (1 diff)
- branches/1.4/test/unit/form/sfFormTest.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/1.3/lib/form/sfForm.class.php
r23214 r24278 735 735 736 736 /** 737 * Returns the current form's options. 738 * 739 * @return array The current form's options 740 */ 741 public function getOptions() 742 { 743 return $this->options; 744 } 745 746 /** 737 747 * Sets an option value. 738 748 * branches/1.3/test/unit/form/sfFormTest.php
r23994 r24278 11 11 require_once(dirname(__FILE__).'/../../bootstrap/unit.php'); 12 12 13 $t = new lime_test(15 4);13 $t = new lime_test(155); 14 14 15 15 class FormTest extends sfForm … … 106 106 $t->ok($f->isCSRFProtected(), '__construct() uses CSRF protection if null is passed as the second argument and it\'s enabled globally'); 107 107 108 // ->getOption() ->setOption() 108 // ->getOption() ->setOption() ->getOptions() 109 109 $t->diag('->getOption() ->setOption()'); 110 110 $f = new FormTest(array(), array('foo' => 'bar')); … … 112 112 $f->setOption('bar', 'foo'); 113 113 $t->is($f->getOption('bar'), 'foo', '->setOption() changes the value of an option'); 114 $t->is_deeply($f->getOptions(), array('foo' => 'bar', 'bar' => 'foo'), '->getOptions() returns all options'); 114 115 115 116 sfForm::disableCSRFProtection(); branches/1.4/lib/form/sfForm.class.php
r23214 r24278 735 735 736 736 /** 737 * Returns the current form's options. 738 * 739 * @return array The current form's options 740 */ 741 public function getOptions() 742 { 743 return $this->options; 744 } 745 746 /** 737 747 * Sets an option value. 738 748 * branches/1.4/test/unit/form/sfFormTest.php
r23994 r24278 11 11 require_once(dirname(__FILE__).'/../../bootstrap/unit.php'); 12 12 13 $t = new lime_test(15 4);13 $t = new lime_test(155); 14 14 15 15 class FormTest extends sfForm … … 106 106 $t->ok($f->isCSRFProtected(), '__construct() uses CSRF protection if null is passed as the second argument and it\'s enabled globally'); 107 107 108 // ->getOption() ->setOption() 108 // ->getOption() ->setOption() ->getOptions() 109 109 $t->diag('->getOption() ->setOption()'); 110 110 $f = new FormTest(array(), array('foo' => 'bar')); … … 112 112 $f->setOption('bar', 'foo'); 113 113 $t->is($f->getOption('bar'), 'foo', '->setOption() changes the value of an option'); 114 $t->is_deeply($f->getOptions(), array('foo' => 'bar', 'bar' => 'foo'), '->getOptions() returns all options'); 114 115 115 116 sfForm::disableCSRFProtection();