Changeset 5642
- Timestamp:
- 10/23/07 17:39:27 (1 year ago)
- Files:
-
- trunk/lib/validator/sfValidatorAll.class.php (modified) (1 diff)
- trunk/lib/validator/sfValidatorAny.class.php (modified) (1 diff)
- trunk/test/unit/validator/sfValidatorAllTest.php (modified) (2 diffs)
- trunk/test/unit/validator/sfValidatorAnyTest.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/lib/validator/sfValidatorAll.class.php
r5632 r5642 86 86 * @see sfValidator 87 87 */ 88 public function clean($value)89 {90 return $this->doClean($value);91 }92 93 /**94 * @see sfValidator95 */96 88 protected function doClean($value) 97 89 { trunk/lib/validator/sfValidatorAny.class.php
r5632 r5642 86 86 * @see sfValidator 87 87 */ 88 public function clean($value)89 {90 return $this->doClean($value);91 }92 93 /**94 * @see sfValidator95 */96 88 protected function doClean($value) 97 89 { trunk/test/unit/validator/sfValidatorAllTest.php
r5632 r5642 11 11 require_once(dirname(__FILE__).'/../../bootstrap/unit.php'); 12 12 13 $t = new lime_test(1 2, new lime_output_color());13 $t = new lime_test(14, new lime_output_color()); 14 14 15 15 $v1 = new sfValidatorString(array('max_length' => 3)); … … 47 47 $t->is($v->clean('foo'), 'foo', '->clean() returns the string unmodified'); 48 48 49 try 50 { 51 $v->clean(null); 52 $t->fail('->clean() throws an sfValidatorError exception if the input value is required'); 53 $t->skip('', 1); 54 } 55 catch (sfValidatorError $e) 56 { 57 $t->pass('->clean() throws an sfValidatorError exception if the input value is required'); 58 $t->is($e->getCode(), 'required', '->clean() throws a sfValidatorError'); 59 } 60 49 61 $v2->setOption('max_length', 2); 50 62 try trunk/test/unit/validator/sfValidatorAnyTest.php
r5632 r5642 11 11 require_once(dirname(__FILE__).'/../../bootstrap/unit.php'); 12 12 13 $t = new lime_test(1 4, new lime_output_color());13 $t = new lime_test(16, new lime_output_color()); 14 14 15 15 $v1 = new sfValidatorString(array('max_length' => 3)); … … 47 47 $t->is($v->clean('foo'), 'foo', '->clean() returns the string unmodified'); 48 48 49 try 50 { 51 $v->clean(null); 52 $t->fail('->clean() throws an sfValidatorError exception if the input value is required'); 53 $t->skip('', 1); 54 } 55 catch (sfValidatorError $e) 56 { 57 $t->pass('->clean() throws an sfValidatorError exception if the input value is required'); 58 $t->is($e->getCode(), 'required', '->clean() throws a sfValidatorError'); 59 } 60 49 61 $v1->setOption('max_length', 1); 50 62 $v2->setOption('min_length', 5);