Development

Changeset 6198

You must first sign up to be able to contribute.

Changeset 6198

Show
Ignore:
Timestamp:
11/28/07 09:00:45 (1 year ago)
Author:
dwhittle
Message:

dwhittle: merged trunk changes to branch (spl exceptions)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/dwhittle/lib/form/sfForm.class.php

    r6159 r6198  
    500500      if (!$widget = $this->widgetSchema[$name]) 
    501501      { 
    502         throw new sfException(sprintf('Widget "%s" does not exist.', $name)); 
     502        throw new InvalidArgumentException(sprintf('Widget "%s" does not exist.', $name)); 
    503503      } 
    504504 
     
    517517   * @param string (ignored) 
    518518   * 
    519    * @throws <b>sfException</b> 
     519   * @throws <b>LogicException</b> 
    520520   */ 
    521521  public function offsetSet($offset, $value) 
    522522  { 
    523     throw new sfException('Cannot update form fields.'); 
     523    throw new LogicException('Cannot update form fields.'); 
    524524  } 
    525525 
  • branches/dwhittle/lib/form/sfFormField.class.php

    r6122 r6198  
    8282    if ($this->widget instanceof sfWidgetFormSchema) 
    8383    { 
    84       throw new sfException('Unable to format a row on a sfWidgetFormSchema.'); 
     84      throw new LogicException('Unable to format a row on a sfWidgetFormSchema.'); 
    8585    } 
    8686 
     
    103103    if ($this->widget instanceof sfWidgetFormSchema) 
    104104    { 
    105       throw new sfException('Unable to format an error list on a sfWidgetFormSchema.'); 
     105      throw new LogicException('Unable to format an error list on a sfWidgetFormSchema.'); 
    106106    } 
    107107 
     
    118118    if ($this->widget instanceof sfWidgetFormSchema) 
    119119    { 
    120       throw new sfException('Unable to render a label on a sfWidgetFormSchema.'); 
     120      throw new LogicException('Unable to render a label on a sfWidgetFormSchema.'); 
    121121    } 
    122122 
     
    133133    if ($this->widget instanceof sfWidgetFormSchema) 
    134134    { 
    135       throw new sfException('Unable to render a label name on a sfWidgetFormSchema.'); 
     135      throw new LogicException('Unable to render a label name on a sfWidgetFormSchema.'); 
    136136    } 
    137137 
     
    224224      if (!$this->widget instanceof sfWidgetFormSchema) 
    225225      { 
    226         throw new sfException(sprintf('Cannot get a form field on a non widget schema (%s given).', get_class($this->widget))); 
     226        throw new LogicException(sprintf('Cannot get a form field on a non widget schema (%s given).', get_class($this->widget))); 
    227227      } 
    228228 
    229229      if (is_null($widget = $this->widget[$name])) 
    230230      { 
    231         throw new sfException(sprintf('Widget "%s" does not exist.', $name)); 
     231        throw new InvalidArgumentException(sprintf('Widget "%s" does not exist.', $name)); 
    232232      } 
    233233 
     
    244244   * @param string (ignored) 
    245245   * 
    246    * @throws <b>sfException</b> 
     246   * @throws <b>LogicException</b> 
    247247   */ 
    248248  public function offsetSet($offset, $value) 
    249249  { 
    250     throw new sfException('Cannot update form fields (read-only).'); 
     250    throw new LogicException('Cannot update form fields (read-only).'); 
    251251  } 
    252252 
     
    256256   * @param string (ignored) 
    257257   * 
    258    * @throws sfException 
     258   * @throws LogicException 
    259259   */ 
    260260  public function offsetUnset($offset) 
    261261  { 
    262     throw new sfException('Cannot remove form fields (read-only).'); 
     262    throw new LogicException('Cannot remove form fields (read-only).'); 
    263263  } 
    264264} 
  • branches/dwhittle/lib/validator/sfValidator.class.php

    r5895 r6198  
    6161    if ($diff = array_diff(array_keys($options), array_merge(array_keys($this->options), $this->requiredOptions))) 
    6262    { 
    63       throw new sfException(sprintf('%s does not support the following options: \'%s\'.', get_class($this), implode('\', \'', $diff))); 
     63      throw new InvalidArgumentException(sprintf('%s does not support the following options: \'%s\'.', get_class($this), implode('\', \'', $diff))); 
    6464    } 
    6565 
     
    6767    if ($diff = array_diff(array_keys($messages), array_keys($this->messages))) 
    6868    { 
    69       throw new sfException(sprintf('%s does not support the following error codes: \'%s\'.', get_class($this), implode('\', \'', $diff))); 
     69      throw new InvalidArgumentException(sprintf('%s does not support the following error codes: \'%s\'.', get_class($this), implode('\', \'', $diff))); 
    7070    } 
    7171 
     
    7373    if ($diff = array_diff($this->requiredOptions, array_merge(array_keys($this->options), array_keys($options)))) 
    7474    { 
    75       throw new sfException(sprintf('%s requires the following options: \'%s\'.', get_class($this), implode('\', \'', $diff))); 
     75      throw new RuntimeException(sprintf('%s requires the following options: \'%s\'.', get_class($this), implode('\', \'', $diff))); 
    7676    } 
    7777 
     
    132132    if (!in_array($name, array_keys($this->messages))) 
    133133    { 
    134       throw new sfException(sprintf('%s does not support the following error code: \'%s\'.', get_class($this), $name)); 
     134      throw new InvalidArgumentException(sprintf('%s does not support the following error code: \'%s\'.', get_class($this), $name)); 
    135135    } 
    136136 
     
    191191    if (!in_array($name, array_merge(array_keys($this->options), $this->requiredOptions))) 
    192192    { 
    193       throw new sfException(sprintf('%s does not support the following option: \'%s\'.', get_class($this), $name)); 
     193      throw new InvalidArgumentException(sprintf('%s does not support the following option: \'%s\'.', get_class($this), $name)); 
    194194    } 
    195195 
  • branches/dwhittle/lib/validator/sfValidatorAll.class.php

    r5821 r6198  
    5252    else if (!is_null($validators)) 
    5353    { 
    54       throw new sfException('sfValidatorAll constructor takes a sfValidator object, or a sfValidator array.'); 
     54      throw new InvalidArgumentException('sfValidatorAll constructor takes a sfValidator object, or a sfValidator array.'); 
    5555    } 
    5656 
  • branches/dwhittle/lib/validator/sfValidatorAny.class.php

    r5821 r6198  
    5252    else if (!is_null($validators)) 
    5353    { 
    54       throw new sfException('sfValidatorAny constructor takes a sfValidator object, or a sfValidator array.'); 
     54      throw new InvalidArgumentException('sfValidatorAny constructor takes a sfValidator object, or a sfValidator array.'); 
    5555    } 
    5656 
  • branches/dwhittle/lib/validator/sfValidatorDecorator.class.php

    r5821 r6198  
    3535    if (!$this->validator instanceof sfValidator) 
    3636    { 
    37       throw new sfException('The getValidator() method must return a sfValidator instance.'); 
     37      throw new RuntimeException('The getValidator() method must return a sfValidator instance.'); 
    3838    } 
    3939 
  • branches/dwhittle/lib/validator/sfValidatorErrorSchema.class.php

    r5582 r6198  
    228228   * @param string (ignored) 
    229229   * 
    230    * @throws <b>sfException</b> 
     230   * @throws <b>LogicException</b> 
    231231   */ 
    232232  public function offsetSet($offset, $value) 
    233233  { 
    234     throw new sfException('Unable update an error.'); 
     234    throw new LogicException('Unable update an error.'); 
    235235  } 
    236236 
     
    239239   * 
    240240   * @param string (ignored) 
    241    * 
    242    * @throws sfException 
    243241   */ 
    244242  public function offsetUnset($offset) 
  • branches/dwhittle/lib/validator/sfValidatorFromDescription.class.php

    r5758 r6198  
    8989        if (!preg_match('/\s*([a-z0-9_\-]+)/', substr($string, $i), $match)) 
    9090        { 
    91           throw new sfException('Parsing problem.'); 
     91          throw new DomainException('Parsing problem.'); 
    9292        } 
    9393 
     
    138138      else 
    139139      { 
    140         throw new sfException(sprintf('Unable to parse string (%s).', $string)); 
     140        throw new DomainException(sprintf('Unable to parse string (%s).', $string)); 
    141141      } 
    142142    } 
     
    238238      if ($token instanceof sfValidatorFDTokenLeftBracket || $token instanceof sfValidatorFDTokenRightBracket) 
    239239      { 
    240         throw new sfException(sprintf('Uneven parenthesis in string (%s).', $this->string)); 
     240        throw new DomainException(sprintf('Uneven parenthesis in string (%s).', $this->string)); 
    241241      } 
    242242 
  • branches/dwhittle/lib/validator/sfValidatorSchema.class.php

    r5969 r6198  
    4949    else if (!is_null($fields)) 
    5050    { 
    51       throw new sfException('sfValidatorSchema constructor takes an array of sfValidator objects.'); 
     51      throw new InvalidArgumentException('sfValidatorSchema constructor takes an array of sfValidator objects.'); 
    5252    } 
    5353 
     
    100100    if (!is_array($values)) 
    101101    { 
    102       throw new sfException('You must pass an array parameter to the clean() method'); 
     102      throw new InvalidArgumentException('You must pass an array parameter to the clean() method'); 
    103103    } 
    104104 
     
    227227    if (!$validator instanceof sfValidator) 
    228228    { 
    229       throw new sfException('A field must be an instance of sfValidator.'); 
     229      throw new InvalidArgumentException('A field must be an instance of sfValidator.'); 
    230230    } 
    231231 
     
    258258  public function asString($indent = 0) 
    259259  { 
    260     throw new sfException('Unable to convert a sfValidatorSchema to string.'); 
     260    throw new Exception('Unable to convert a sfValidatorSchema to string.'); 
    261261  } 
    262262} 
  • branches/dwhittle/lib/validator/sfValidatorSchemaCompare.class.php

    r5895 r6198  
    6767    if (!is_array($values)) 
    6868    { 
    69       throw new sfException('You must pass an array parameter to the clean() method'); 
     69      throw new InvalidArgumentException('You must pass an array parameter to the clean() method'); 
    7070    } 
    7171 
  • branches/dwhittle/lib/validator/sfValidatorSchemaFilter.class.php

    r5895 r6198  
    4949    if (!is_array($values)) 
    5050    { 
    51       throw new sfException('You must pass an array parameter to the clean() method'); 
     51      throw new InvalidArgumentException('You must pass an array parameter to the clean() method'); 
    5252    } 
    5353 
  • branches/dwhittle/lib/validator/sfValidatorSchemaForEach.class.php

    r5758 r6198  
    4747  public function asString($indent = 0) 
    4848  { 
    49     throw new sfException('Unable to convert a sfValidatorSchemaForEach to string.'); 
     49    throw new Exception('Unable to convert a sfValidatorSchemaForEach to string.'); 
    5050  } 
    5151} 
  • branches/dwhittle/lib/widget/sfWidget.class.php

    r6159 r6198  
    4141    if ($diff = array_diff(array_keys($options), array_merge(array_keys($this->options), $this->requiredOptions))) 
    4242    { 
    43       throw new sfException(sprintf('%s does not support the following options: \'%s\'.', get_class($this), implode('\', \'', $diff))); 
     43      throw new InvalidArgumentException(sprintf('%s does not support the following options: \'%s\'.', get_class($this), implode('\', \'', $diff))); 
    4444    } 
    4545 
     
    4747    if ($diff = array_diff($this->requiredOptions, array_merge(array_keys($this->options), array_keys($options)))) 
    4848    { 
    49       throw new sfException(sprintf('%s requires the following options: \'%s\'.', get_class($this), implode('\', \'', $diff))); 
     49      throw new RuntimeException(sprintf('%s requires the following options: \'%s\'.', get_class($this), implode('\', \'', $diff))); 
    5050    } 
    5151 
     
    128128    if (!in_array($name, array_merge(array_keys($this->options), $this->requiredOptions))) 
    129129    { 
    130       throw new sfException(sprintf('%s does not support the following option: \'%s\'.', get_class($this), $name)); 
     130      throw new InvalidArgumentException(sprintf('%s does not support the following option: \'%s\'.', get_class($this), $name)); 
    131131    } 
    132132 
  • branches/dwhittle/lib/widget/sfWidgetFormDateTime.class.php

    r5969 r6198  
    7575    if (!is_array($options)) 
    7676    { 
    77       throw new sfException(sprintf('You must pass an array for the %s option.', $type)); 
     77      throw new InvalidArgumentException(sprintf('You must pass an array for the %s option.', $type)); 
    7878    } 
    7979 
  • branches/dwhittle/lib/widget/sfWidgetFormSchema.class.php

    r5999 r6198  
    6767    else if (!is_null($fields)) 
    6868    { 
    69       throw new sfException('sfWidgetFormSchema constructor takes an array of sfWidget objects.'); 
     69      throw new InvalidArgumentException('sfWidgetFormSchema constructor takes an array of sfWidget objects.'); 
    7070    } 
    7171 
     
    124124   * @return sfWidgetFormSchemaFormatter sfWidgetFormSchemaFormatter instance 
    125125   * 
    126    * @throws sfException 
     126   * @throws InvalidArgumentException 
    127127   */ 
    128128  public function getFormFormatter() 
     
    141141    } 
    142142 
    143     throw new sfException(sprintf('The form formatter "%s" does not exist.', $name)); 
     143    throw new InvalidArgumentException(sprintf('The form formatter "%s" does not exist.', $name)); 
    144144  } 
    145145 
     
    280280    if (is_null($widget = $this[$name])) 
    281281    { 
    282       throw new sfException(sprintf('The field named "%s" does not exist.', $name)); 
     282      throw new InvalidArgumentException(sprintf('The field named "%s" does not exist.', $name)); 
    283283    } 
    284284 
     
    309309    if (!is_array($values) && !$values instanceof ArrayAccess) 
    310310    { 
    311       throw new sfException('You must pass an array of values to render a widget schema'); 
     311      throw new InvalidArgumentException('You must pass an array of values to render a widget schema'); 
    312312    } 
    313313 
     
    460460    if (!$widget instanceof sfWidget) 
    461461    { 
    462       throw new sfException('A field must be an instance of sfWidget.'); 
     462      throw new InvalidArgumentException('A field must be an instance of sfWidget.'); 
    463463    } 
    464464 
     
    519519    if (array_diff($positions, array_keys($this->fields)) || array_diff(array_keys($this->fields), $positions)) 
    520520    { 
    521       throw new sfException('Positions must contains all field names.'); 
     521      throw new InvalidArgumentException('Positions must contains all field names.'); 
    522522    } 
    523523 
     
    543543    if (false === $fieldPosition = array_search($field, $this->positions)) 
    544544    { 
    545       throw new sfException(sprintf('Field "%s" does not exist.', $field)); 
     545      throw new InvalidArgumentException(sprintf('Field "%s" does not exist.', $field)); 
    546546    } 
    547547    unset($this->positions[$fieldPosition]); 
     
    552552      if (false === $pivotPosition = array_search($pivot, $this->positions)) 
    553553      { 
    554         throw new sfException(sprintf('Field "%s" does not exist.', $pivot)); 
     554        throw new InvalidArgumentException(sprintf('Field "%s" does not exist.', $pivot)); 
    555555      } 
    556556    } 
     
    567567        if (is_null($pivot)) 
    568568        { 
    569           throw new sfException(sprintf('Unable to move field "%s" without a relative field.', $field)); 
     569          throw new LogicException(sprintf('Unable to move field "%s" without a relative field.', $field)); 
    570570        } 
    571571        $this->positions = array_merge( 
     
    578578        if (is_null($pivot)) 
    579579        { 
    580           throw new sfException(sprintf('Unable to move field "%s" without a relative field.', $field)); 
     580          throw new LogicException(sprintf('Unable to move field "%s" without a relative field.', $field)); 
    581581        } 
    582582        $this->positions = array_merge( 
     
    587587        break; 
    588588      default: 
    589         throw new sfException(sprintf('Unknown move operation for field "%s".', $field)); 
     589        throw new LogicException(sprintf('Unknown move operation for field "%s".', $field)); 
    590590    } 
    591591  } 
  • branches/dwhittle/test/unit/form/sfFormFieldTest.php

    r6122 r6198  
    3333  $t->fail('sfFormField implements the ArrayAccess interface but in read-only mode'); 
    3434} 
    35 catch (sfException $e) 
     35catch (LogicException $e) 
    3636{ 
    3737  $t->pass('sfFormField implements the ArrayAccess interface but in read-only mode'); 
     
    4343  $t->fail('sfFormField implements the ArrayAccess interface but in read-only mode'); 
    4444} 
    45 catch (sfException $e) 
     45catch (LogicException $e) 
    4646{ 
    4747  $t->pass('sfFormField implements the ArrayAccess interface but in read-only mode'); 
     
    5353  $t->fail('sfFormField implements the ArrayAccess interface but in read-only mode'); 
    5454} 
    55 catch (sfException $e) 
     55catch (LogicException $e) 
    5656{ 
    5757  $t->pass('sfFormField implements the ArrayAccess interface but in read-only mode'); 
     
    6363  $t->fail('sfFormField implements the ArrayAccess interface but in read-only mode'); 
    6464} 
    65 catch (sfException $e) 
     65catch (LogicException $e) 
    6666{ 
    6767  $t->pass('sfFormField implements the ArrayAccess interface but in read-only mode'); 
     
    117117{ 
    118118  $parent->renderRow(); 
    119   $t->fail('->renderRow() throws an sfException if the form field is a schema'); 
     119  $t->fail('->renderRow() throws an LogicException if the form field is a schema'); 
    120120} 
    121 catch (sfException $e) 
     121catch (LogicException $e) 
    122122{ 
    123   $t->pass('->renderRow() throws an sfException if the form field is a schema'); 
     123  $t->pass('->renderRow() throws an LogicException if the form field is a schema'); 
    124124} 
    125125 
     
    136136{ 
    137137  $parent->renderError(); 
    138   $t->fail('->renderError() throws an sfException if the form field is a schema'); 
     138  $t->fail('->renderError() throws an LogicException if the form field is a schema'); 
    139139} 
    140 catch (sfException $e) 
     140catch (LogicException $e) 
    141141{ 
    142   $t->pass('->renderError() throws an sfException if the form field is a schema'); 
     142  $t->pass('->renderError() throws an LogicException if the form field is a schema'); 
    143143} 
    144144 
     
    149149{ 
    150150  $parent->renderLabel(); 
    151   $t->fail('->renderLabel() throws an sfException if the form field is a schema'); 
     151  $t->fail('->renderLabel() throws an LogicException if the form field is a schema'); 
    152152} 
    153 catch (sfException $e) 
     153catch (LogicException $e) 
    154154{ 
    155   $t->pass('->renderLabel() throws an sfException if the form field is a schema'); 
     155  $t->pass('->renderLabel() throws an LogicException if the form field is a schema'); 
    156156} 
    157157 
     
    162162{ 
    163163  $parent->renderLabelName(); 
    164   $t->fail('->renderLabelName() throws an sfException if the form field is a schema'); 
     164  $t->fail('->renderLabelName() throws an LogicException if the form field is a schema'); 
    165165} 
    166 catch (sfException $e) 
     166catch (LogicException $e) 
    167167{ 
    168   $t->pass('->renderLabelName() throws an sfException if the form field is a schema'); 
     168  $t->pass('->renderLabelName() throws an LogicException if the form field is a schema'); 
    169169} 
    170170 
  • branches/dwhittle/test/unit/form/sfFormTest.php

    r6122 r6198  
    115115  $t->fail('sfForm ArrayAccess implementation does not permit to set a form field'); 
    116116} 
    117 catch (sfException $e) 
     117catch (LogicException $e) 
    118118{ 
    119119  $t->pass('sfForm ArrayAccess implementation does not permit to set a form field'); 
     
    129129{ 
    130130  $f['nonexistant']; 
    131   $t->fail('sfForm ArrayAccess implementation throws a sfException if the form field does not exist'); 
    132 } 
    133 catch (sfException $e) 
    134 { 
    135   $t->pass('sfForm ArrayAccess implementation throws a sfException if the form field does not exist'); 
     131  $t->fail('sfForm ArrayAccess implementation throws a LogicException if the form field does not exist'); 
     132} 
     133catch (LogicException $e) 
     134{ 
     135  $t->pass('sfForm ArrayAccess implementation throws a LogicException if the form field does not exist'); 
    136136} 
    137137 
  • branches/dwhittle/test/unit/validator/sfValidatorAllTest.php

    r5758 r6198  
    3131  $t->fail('__construct() throws an exception when passing a non supported first argument'); 
    3232} 
    33 catch (sfException $e) 
     33catch (InvalidArgumentException $e) 
    3434{ 
    3535  $t->pass('__construct() throws an exception when passing a non supported first argument'); 
  • branches/dwhittle/test/unit/validator/sfValidatorAnyTest.php

    r5758 r6198  
    3131  $t->fail('_construct() throws an exception when passing a non supported first argument'); 
    3232} 
    33 catch (sfException $e) 
     33catch (InvalidArgumentException $e) 
    3434{ 
    3535  $t->pass('_construct() throws an exception when passing a non supported first argument'); 
  • branches/dwhittle/test/unit/validator/sfValidatorCSRFTokenTest.php

    r6030 r6198  
    1818{ 
    1919  new sfValidatorCSRFToken(); 
    20   $t->fail('__construct() throws an sfException if you don\'t pass a token option'); 
     20  $t->fail('__construct() throws an RuntimeException if you don\'t pass a token option'); 
    2121} 
    22 catch (sfException $e) 
     22catch (RuntimeException $e) 
    2323{ 
    24   $t->pass('__construct() throws an sfException if you don\'t pass a token option'); 
     24  $t->pass('__construct() throws an RuntimeException if you don\'t pass a token option'); 
    2525} 
    2626 
  • branches/dwhittle/test/unit/validator/sfValidatorCallbackTest.php

    r5758 r6198  
    2828{ 
    2929  new sfValidatorCallback(); 
    30   $t->fail('__construct() throws an sfException if you don\'t pass a callback option'); 
     30  $t->fail('__construct() throws an RuntimeException if you don\'t pass a callback option'); 
    3131} 
    32 catch (sfException $e) 
     32catch (RuntimeException $e) 
    3333{ 
    34   $t->pass('__construct() throws an sfException if you don\'t pass a callback option'); 
     34  $t->pass('__construct() throws an RuntimeException if you don\'t pass a callback option'); 
    3535} 
    3636 
  • branches/dwhittle/test/unit/validator/sfValidatorChoiceTest.php

    r5821 r6198  
    2323{ 
    2424  new sfValidatorChoice(); 
    25   $t->fail('__construct() throws an sfException if you don\'t pass an expected option'); 
     25  $t->fail('__construct() throws an RuntimeException if you don\'t pass an expected option'); 
    2626} 
    27 catch (sfException $e) 
     27catch (RuntimeException $e) 
    2828{ 
    29   $t->pass('__construct() throws an sfException if you don\'t pass an expected option'); 
     29  $t->pass('__construct() throws an RuntimeException if you don\'t pass an expected option'); 
    3030} 
    3131 
  • branches/dwhittle/test/unit/validator/sfValidatorDecoratorTest.php

    r5821 r6198  
    111111{ 
    112112  $v = new FakeValidator(); 
    113   $t->fail('->clean() throws a sfValidatorError if getValidator() does not return a sfValidator instance'); 
     113  $t->fail('->clean() throws a RuntimeException if getValidator() does not return a sfValidator instance'); 
    114114} 
    115 catch (sfException $e) 
     115catch (RuntimeException $e) 
    116116{ 
    117   $t->pass('->clean() throws a sfValidatorError if getValidator() does not return a sfValidator instance'); 
     117  $t->pass('->clean() throws a RuntimeException if getValidator() does not return a sfValidator instance'); 
    118118} 
  • branches/dwhittle/test/unit/validator/sfValidatorErrorSchemaTest.php

    r5582 r6198  
    9292  $t->fail('sfValidatorErrorSchema implements the ArrayAccess interface'); 
    9393} 
    94 catch (sfException $e) 
     94catch (LogicException $e) 
    9595{ 
    9696  $t->pass('sfValidatorErrorSchema implements the ArrayAccess interface'); 
  • branches/dwhittle/test/unit/validator/sfValidatorRegexTest.php

    r5821 r6198  
    1818{ 
    1919  new sfValidatorRegex(); 
    20   $t->fail('__construct() throws an sfException if you don\'t pass a pattern option'); 
     20  $t->fail('__construct() throws an RuntimeException if you don\'t pass a pattern option'); 
    2121} 
    22 catch (sfException $e) 
     22catch (RuntimeException $e) 
    2323{ 
    24   $t->pass('__construct() throws an sfException if you don\'t pass a pattern option'); 
     24  $t->pass('__construct() throws an RuntimeException if you don\'t pass a pattern option'); 
    2525} 
    2626 
  • branches/dwhittle/test/unit/validator/sfValidatorSchemaCompareTest.php

    r5758 r6198  
    5959{ 
    6060  $v->clean('foo'); 
    61   $t->fail('->clean() throws an sfException exception if the first argument is not an array of value'); 
     61  $t->fail('->clean() throws an InvalidArgumentException exception if the first argument is not an array of value'); 
    6262} 
    63 catch (sfException $e) 
     63catch (InvalidArgumentException $e) 
    6464{ 
    65   $t->pass('->clean() throws an sfException exception if the first argument is not an array of value'); 
     65  $t->pass('->clean() throws an InvalidArgumentException exception if the first argument is not an array of value'); 
    6666} 
    6767 
  • branches/dwhittle/test/unit/validator/sfValidatorSchemaFilterTest.php

    r5651 r6198  
    2424{ 
    2525  $v->clean('string'); 
    26   $t->fail('->clean() throws a sfException if the input value is not an array'); 
     26  $t->fail('->clean() throws a InvalidArgumentException if the input value is not an array'); 
    2727} 
    28 catch (sfException $e) 
     28catch (InvalidArgumentException $e) 
    2929{ 
    30   $t->pass('->clean() throws a sfException if the input value is not an array'); 
     30  $t->pass('->clean() throws a InvalidArgumentException if the input value is not an array'); 
    3131} 
    3232 
  • branches/dwhittle/test/unit/validator/sfValidatorSchemaTest.php

    r5969 r6198  
    5959{ 
    6060  $v = new sfValidatorSchema('string'); 
    61   $t->fail('__construct() throws an exception when passing a non supported first argument'); 
    62 } 
    63 catch (sfException $e) 
    64 { 
    65   $t->pass('__construct() throws an exception when passing a non supported first argument'); 
     61  $t->fail('__construct() throws an InvalidArgumentException when passing a non supported first argument'); 
     62} 
     63catch (InvalidArgumentException $e) 
     64{ 
     65  $t->pass('__construct() throws an InvalidArgumentException when passing a non supported first argument'); 
    6666} 
    6767 
     
    7878  $t->fail('sfValidatorSchema implements the ArrayAccess interface for the fields'); 
    7979} 
    80 catch (sfException $e) 
     80catch (InvalidArgumentException $e) 
    8181{ 
    8282  $t->pass('sfValidatorSchema implements the ArrayAccess interface for the fields'); 
     
    119119{ 
    120120  $v->clean('foo'); 
    121   $t->fail('->clean() throws an sfException exception if the first argument is not an array of value'); 
    122 } 
    123 catch (sfException $e) 
    124 { 
    125   $t->pass('->clean() throws an sfException exception if the first argument is not an array of value'); 
     121  $t->fail('->clean() throws an InvalidArgumentException exception if the first argument is not an array of value'); 
     122} 
     123catch (InvalidArgumentException $e) 
     124{ 
     125  $t->pass('->clean() throws an InvalidArgumentException exception if the first argument is not an array of value'); 
    126126} 
    127127 
  • branches/dwhittle/test/unit/validator/sfValidatorTest.php

    r5895 r6198  
    5454{ 
    5555  new ValidatorIdentity(array('nonexistant' => false, 'foo' => 'foobar', 'anothernonexistant' => 'bar', 'required' => true)); 
    56   $t->fail('__construct() throws an sfException if you pass some non existant options'); 
     56  $t->fail('__construct() throws an InvalidArgumentException if you pass some non existant options'); 
    5757  $t->skip(); 
    5858} 
    59 catch (sfException $e) 
    60 { 
    61   $t->pass('__construct() throws an sfException if you pass some non existant options'); 
     59catch (InvalidArgumentException $e) 
     60{ 
     61  $t->pass('__construct() throws an InvalidArgumentException if you pass some non existant options'); 
    6262  $t->like($e->getMessage(), '/ \'nonexistant\', \'anothernonexistant\'/', 'The exception contains the non existant option names'); 
    6363} 
     
    6666{ 
    6767  new ValidatorIdentity(array(), array('required' => 'This is required.', 'nonexistant' => 'foo', 'anothernonexistant' => false)); 
    68   $t->fail('__construct() throws an sfException if you pass some non existant error codes'); 
     68  $t->fail('__construct() throws an InvalidArgumentException if you pass some non existant error codes'); 
    6969  $t->skip(); 
    7070} 
    71 catch (sfException $e) 
    72 { 
    73   $t->pass('__construct() throws an sfException if you pass some non existant error codes'); 
     71catch (InvalidArgumentException $e) 
     72{ 
     73  $t->pass('__construct() throws an InvalidArgumentException if you pass some non existant error codes'); 
    7474  $t->like($e->getMessage(), '/ \'nonexistant\', \'anothernonexistant\'/', 'The exception contains the non existant error codes'); 
    7575} 
     
    8383{ 
    8484  new ValidatorIdentityWithRequired(); 
    85   $t->fail('__construct() throws an sfException if you don\'t pass a required option'); 
    86 } 
    87 catch (sfException $e) 
    88 { 
    89   $t->pass('__construct() throws an sfException if you don\'t pass a required option'); 
     85  $t->fail('__construct() throws an RuntimeException if you don\'t pass a required option'); 
     86} 
     87catch (RuntimeException $e) 
     88{ 
     89  $t->pass('__construct() throws an RuntimeException if you don\'t pass a required option'); 
    9090} 
    9191 
     
    122122{ 
    123123  $v->setOption('foobar', 'foo'); 
    124   $t->fail('->setOption() throws an sfException if the option is not registered'); 
    125 } 
    126 catch (sfException $e) 
    127 { 
    128   $t->pass('->setOption() throws an sfException if the option is not registered'); 
     124  $t->fail('->setOption() throws an InvalidArgumentException if the option is not registered'); 
     125} 
     126catch (InvalidArgumentException $e) 
     127{ 
     128  $t->pass('->setOption() throws an InvalidArgumentException if the option is not registered'); 
    129129} 
    130130 
     
    175175{ 
    176176  $v->setMessage('foobar', 'foo'); 
    177   $t->fail('->setMessage() throws an sfException if the message is not registered'); 
    178 } 
    179 catch (sfException $e) 
    180 { 
    181   $t->pass('->setMessage() throws an sfException if the message is not registered'); 
     177  $t->fail('->setMessage() throws an InvalidArgumentException if the message is not registered'); 
     178} 
     179catch (InvalidArgumentException $e) 
     180{ 
     181  $t->pass('->setMessage() throws an InvalidArgumentException if the message is not registered'); 
    182182} 
    183183 
  • branches/dwhittle/test/unit/widget/sfWidgetFormDateTimeTest.php

    r6189 r6198  
    9393{ 
    9494  $w->render('foo'); 
    95   $t->fail('__construct() throws a sfException if the date/time options is not an array'); 
     95  $t->fail('__construct() throws a InvalidArgumentException if the date/time options is not an array'); 
    9696} 
    97 catch (sfException $e) 
     97catch (InvalidArgumentException $e) 
    9898{ 
    99   $t->pass('__construct() throws a sfException if the date/time options is not an array'); 
     99  $t->pass('__construct() throws a InvalidArgumentException if the date/time options is not an array'); 
    100100} 
  • branches/dwhittle/test/unit/widget/sfWidgetFormSchemaDecoratorTest.php

    r5943 r6198  
    4242  $t->fail('sfWidgetFormSchemaDecorator implements the ArrayAccess interface for the fields');