Development

Changeset 10800

You must first sign up to be able to contribute.

Changeset 10800

Show
Ignore:
Timestamp:
08/12/08 08:41:50 (11 months ago)
Author:
fabien
Message:

[1.2] changed the sfValidatorSchemaCompare constant values

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/1.2/UPGRADE_TO_1_2

    r10630 r10800  
    5050 
    5151This change removes the dependency between `sfResponse` and `sfConfig`. 
     52 
     53Validators 
     54---------- 
     55 
     56The `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  
    1919class sfValidatorSchemaCompare extends sfValidatorSchema 
    2020{ 
    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 = '>='; 
    2727 
    2828  /** 
  • branches/1.2/test/unit/validator/sfValidatorSchemaCompareTest.php

    r6954 r10800  
    1111require_once(dirname(__FILE__).'/../../bootstrap/unit.php'); 
    1212 
    13 $t = new lime_test(43, new lime_output_color()); 
     13$t = new lime_test(83, new lime_output_color()); 
    1414 
    1515$v = new sfValidatorSchemaCompare('left', sfValidatorSchemaCompare::EQUAL, 'right'); 
     
    2626  array(array('left' => 2, 'right' => 2), sfValidatorSchemaCompare::GREATER_THAN_EQUAL), 
    2727  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'), '!='), 
    2837) as $values) 
    2938{ 
     
    4150  array(array('left' => 3, 'right' => 2), sfValidatorSchemaCompare::LESS_THAN_EQUAL), 
    4251  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'), '=='), 
    4361) as $values) 
    4462{ 

The Sensio Labs Network

Since 1998, Sensio Labs has been promoting the Open-Source software movement by providing quality web application development, training, consulting, and supporting several large Open-Source projects.