Changeset 8052
- Timestamp:
- 03/23/08 03:30:30 (1 year ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/1.0/lib/validator/sfNumberValidator.class.php
r7791 r8052 46 46 public function execute(&$value, &$error) 47 47 { 48 if (!preg_match('/^ \d+(\.\d+)?$/', $value))48 if (!preg_match('/^-?\d+(\.\d+)?$/', $value)) 49 49 { 50 50 // it's NaN, what nerve! branches/1.0/test/unit/validator/sfNumberValidatorTest.php
r7589 r8052 13 13 require_once($_test_dir.'/unit/sfValidatorTestHelper.class.php'); 14 14 15 $t = new lime_test(5 1, new lime_output_color());15 $t = new lime_test(53, new lime_output_color()); 16 16 17 17 $context = new sfContext(); … … 86 86 $h->launchTests($v, 4, true, 'type', 'type_error', array('type' => 'any')); 87 87 88 // number is negative 89 $t->diag('->execute() - number is negative'); 90 $h->launchTests($v, -4, true, 'type', 'type_error', array('type' => 'any')); 91 88 92 // conversion of value 89 93 $t->diag('->execute() - conversion of value');

