Changeset 10800
- Timestamp:
- 08/12/08 08:41:50 (11 months ago)
- Files:
-
- branches/1.2/UPGRADE_TO_1_2 (modified) (1 diff)
- branches/1.2/lib/validator/sfValidatorSchemaCompare.class.php (modified) (1 diff)
- branches/1.2/test/unit/validator/sfValidatorSchemaCompareTest.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/1.2/UPGRADE_TO_1_2
r10630 r10800 50 50 51 51 This change removes the dependency between `sfResponse` and `sfConfig`. 52 53 Validators 54 ---------- 55 56 The `sfValidatorSchemaCompare` constant values have been changed. No change to your code need to be done, but now, you can use nice shortcuts. The following two examples are equivalent: 57 58 [php] 59 // symfony 1.1 and 1.2 60 $v = new sfValidatorSchemaCompare('left', sfValidatorSchemaCompare::EQUAL, 'right'); 61 62 // symfony 1.2 only 63 $v = new sfValidatorSchemaCompare('left', '==', 'right'); branches/1.2/lib/validator/sfValidatorSchemaCompare.class.php
r9048 r10800 19 19 class sfValidatorSchemaCompare extends sfValidatorSchema 20 20 { 21 const EQUAL = ' equal';22 const NOT_EQUAL = ' not_equal';23 const LESS_THAN = ' less_than';24 const LESS_THAN_EQUAL = ' less_than_equal';25 const GREATER_THAN = ' greater_than';26 const GREATER_THAN_EQUAL = ' greater_than_equal';21 const EQUAL = '=='; 22 const NOT_EQUAL = '!='; 23 const LESS_THAN = '<'; 24 const LESS_THAN_EQUAL = '<='; 25 const GREATER_THAN = '>'; 26 const GREATER_THAN_EQUAL = '>='; 27 27 28 28 /** branches/1.2/test/unit/validator/sfValidatorSchemaCompareTest.php
r6954 r10800 11 11 require_once(dirname(__FILE__).'/../../bootstrap/unit.php'); 12 12 13 $t = new lime_test( 43, new lime_output_color());13 $t = new lime_test(83, new lime_output_color()); 14 14 15 15 $v = new sfValidatorSchemaCompare('left', sfValidatorSchemaCompare::EQUAL, 'right'); … … 26 26 array(array('left' => 2, 'right' => 2), sfValidatorSchemaCompare::GREATER_THAN_EQUAL), 27 27 array(array('left' => 'foo', 'right' => 'bar'), sfValidatorSchemaCompare::NOT_EQUAL), 28 29 array(array('left' => 'foo', 'right' => 'foo'), '=='), 30 array(array(), '=='), 31 array(null, '=='), 32 array(array('left' => 1, 'right' => 2), '<'), 33 array(array('left' => 2, 'right' => 2), '<='), 34 array(array('left' => 2, 'right' => 1), '>'), 35 array(array('left' => 2, 'right' => 2), '>='), 36 array(array('left' => 'foo', 'right' => 'bar'), '!='), 28 37 ) as $values) 29 38 { … … 41 50 array(array('left' => 3, 'right' => 2), sfValidatorSchemaCompare::LESS_THAN_EQUAL), 42 51 array(array('left' => 'foo', 'right' => 'bar'), sfValidatorSchemaCompare::EQUAL), 52 53 array(array('left' => 'foo', 'right' => 'foo'), '!='), 54 array(array(), '!='), 55 array(null, '!='), 56 array(array('left' => 1, 'right' => 2), '>'), 57 array(array('left' => 2, 'right' => 3), '>='), 58 array(array('left' => 2, 'right' => 1), '<'), 59 array(array('left' => 3, 'right' => 2), '<='), 60 array(array('left' => 'foo', 'right' => 'bar'), '=='), 43 61 ) as $values) 44 62 {

