Development

Changeset 6197

You must first sign up to be able to contribute.

Changeset 6197

Show
Ignore:
Timestamp:
11/28/07 08:50:09 (9 months ago)
Author:
fabien
Message:

replaced sfException exceptions to SPL exceptions

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/test/unit/form/sfFormFieldTest.php

    r6115 r6197  
    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 
  • trunk/test/unit/form/sfFormTest.php

    r6114 r6197  
    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 
  • trunk/test/unit/validator/sfValidatorAllTest.php

    r5753 r6197  
    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'); 
  • trunk/test/unit/validator/sfValidatorAnyTest.php

    r5753 r6197  
    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'); 
  • trunk/test/unit/validator/sfValidatorCSRFTokenTest.php

    r6022 r6197  
    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 
  • trunk/test/unit/validator/sfValidatorCallbackTest.php

    r5753 r6197  
    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 
  • trunk/test/unit/validator/sfValidatorChoiceTest.php

    r5819 r6197  
    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 
  • trunk/test/unit/validator/sfValidatorDecoratorTest.php

    r5816 r6197  
    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} 
  • trunk/test/unit/validator/sfValidatorErrorSchemaTest.php

    r5581 r6197  
    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'); 
  • trunk/test/unit/validator/sfValidatorRegexTest.php

    r5816 r6197  
    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 
  • trunk/test/unit/validator/sfValidatorSchemaCompareTest.php

    r5753 r6197  
    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 
  • trunk/test/unit/validator/sfValidatorSchemaFilterTest.php

    r5638 r6197  
    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 
  • trunk/test/unit/validator/sfValidatorSchemaTest.php

    r5949 r6197  
    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 
  • trunk/test/unit/validator/sfValidatorTest.php

    r5882 r6197  
    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 
  • trunk/test/unit/widget/sfWidgetFormDateTimeTest.php

    r5950 r6197  
    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} 
  • trunk/test/unit/widget/sfWidgetFormSchemaDecoratorTest.php

    r5937 r6197  
    4242  $t->fail('sfWidgetFormSchemaDecorator implements the ArrayAccess interface for the fields'); 
    4343} 
    44 catch (sfException $e) 
     44catch (LogicException $e) 
    4545{ 
    4646  $t->pass('sfWidgetFormSchemaDecorator implements the ArrayAccess interface for the fields'); 
  • trunk/test/unit/widget/sfWidgetFormSchemaTest.php

    r5996 r6197  
    2727  $t->fail('__construct() throws a exception when passing a non supported first argument'); 
    2828} 
    29 catch (sfException $e) 
     29catch (InvalidArgumentException $e) 
    3030{ 
    3131  $t->pass('__construct() throws an exception when passing a non supported first argument'); 
     
    5252  $t->fail('sfWidgetFormSchema implements the ArrayAccess interface for the fields'); 
    5353} 
    54 catch (sfException $e) 
     54catch (LogicException $e) 
    5555{ 
    5656  $t->pass('sfWidgetFormSchema implements the ArrayAccess interface for the fields'); 
     
    8686{ 
    8787  $w->getFormFormatter(); 
    88   $t->fail('->setFormFormatterName() throws a sfException when the form format name is not associated with a formatter'); 
    89 } 
    90 catch (sfException $e) 
    91 { 
    92   $t->pass('->setFormFormatterName() throws a sfException when the form format name is not associated with a formatter'); 
     88  $t->fail('->setFormFormatterName() throws a InvalidArgumentException when the form format name is not associated with a formatter'); 
     89} 
     90catch (InvalidArgumentException $e) 
     91{ 
     92  $t->pass('->setFormFormatterName() throws a InvalidArgumentException when the form format name is not associated with a formatter'); 
    9393} 
    9494 
     
    151151{ 
    152152  $w->renderField('last_name', 'Potencier'); 
    153   $t->fail('->renderField() throws an sfException if the field does not exist'); 
    154 } 
    155 catch (sfException $e) 
    156 { 
    157   $t->pass('->renderField() throws an sfException if the field does not exist'); 
     153  $t->fail('->renderField() throws an InvalidArgumentException if the field does not exist'); 
     154} 
     155catch (InvalidArgumentException $e) 
     156{ 
     157  $t->pass('->renderField() throws an InvalidArgumentException if the field does not exist'); 
    158158} 
    159159 
     
    177177{ 
    178178  $w->setPositions(array('w1', 'w2', 'w3')); 
    179   $t->fail('->setPositions() throws an exception if you give it a non existant field name'); 
    180 } 
    181 catch (sfException $e) 
    182 { 
    183   $t->pass('->setPositions() throws an exception if you give it a non existant field name'); 
     179  $t->fail('->setPositions() throws an InvalidArgumentException if you give it a non existant field name'); 
     180} 
     181catch (InvalidArgumentException $e) 
     182{ 
     183  $t->pass('->setPositions() throws an InvalidArgumentException if you give it a non existant field name'); 
    184184} 
    185185 
     
    187187{ 
    188188  $w->setPositions(array('w1')); 
    189   $t->fail('->setPositions() throws an exception if you miss a field name'); 
    190 } 
    191 catch (sfException $e) 
    192 { 
    193   $t->pass('->setPositions() throws an exception if you miss a field name'); 
     189  $t->fail('->setPositions() throws an InvalidArgumentException if you miss a field name'); 
     190} 
     191catch (InvalidArgumentException $e) 
     192{ 
     193  $t->pass('->setPositions() throws an InvalidArgumentException if you miss a field name'); 
    194194} 
    195195 
     
    212212{ 
    213213  $w->moveField('w1', sfWidgetFormSchema::AFTER); 
    214   $t->fail('->moveField() throws an exception if you don\'t pass a relative field name with AFTER'); 
    215 } 
    216 catch (sfException $e) 
    217 { 
    218   $t->pass('->moveField() throws an exception if you don\'t pass a relative field name with AFTER'); 
     214  $t->fail('->moveField() throws an LogicException if you don\'t pass a relative field name with AFTER'); 
     215} 
     216catch (LogicException $e) 
     217{ 
     218  $t->pass('->moveField() throws an LogicException if you don\'t pass a relative field name with AFTER'); 
    219219} 
    220220try 
    221221{ 
    222222  $w->moveField('w1', sfWidgetFormSchema::BEFORE); 
    223   $t->fail('->moveField() throws an exception if you don\'t pass a relative field name with BEFORE'); 
    224 } 
    225 catch (sfException $e) 
    226 { 
    227   $t->pass('->moveField() throws an exception if you don\'t pass a relative field name with BEFORE'); 
     223  $t->fail('->moveField() throws an LogicException if you don\'t pass a relative field name with BEFORE'); 
     224} 
     225catch (LogicException $e) 
     226{ 
     227  $t->pass('->moveField() throws an LogicException if you don\'t pass a relative field name with BEFORE'); 
    228228} 
    229229 
     
    235235{ 
    236236  $w->render(null, 'string'); 
    237   $t->fail('->render() throws an sfException if the second argument is not an array'); 
    238 } 
    239 catch (sfException $e) 
    240 { 
    241   $t->pass('->render() throws an sfException if the second argument is not an array'); 
     237  $t->fail('->render() throws an InvalidArgumentException if the second argument is not an array'); 
     238} 
     239catch (InvalidArgumentException $e) 
     240{ 
     241  $t->pass('->render() throws an InvalidArgumentException if the second argument is not an array'); 
    242242} 
    243243 
  • trunk/test/unit/widget/sfWidgetFormSelectTest.php

    r5937 r6197  
    5050{ 
    5151  $w = new sfWidgetFormSelect(); 
    52   $t->fail('__construct() throws an sfException if you don\'t pass a choices option'); 
     52  $t->fail('__construct() throws an RuntimeException if you don\'t pass a choices option'); 
    5353} 
    54 catch (sfException $e) 
     54catch (RuntimeException $e) 
    5555{ 
    56   $t->pass('__construct() throws an sfException if you don\'t pass a choices option'); 
     56  $t->pass('__construct() throws an RuntimeException if you don\'t pass a choices option'); 
    5757} 
    5858 
  • trunk/test/unit/widget/sfWidgetTest.php

    r5937 r6197  
    4444{ 
    4545  new MyWidget(array('nonexistant' => false)); 
    46   $t->fail('__construct() throws an sfException if you pass some non existant options'); 
     46  $t->fail('__construct() throws an InvalidArgumentException if you pass some non existant options'); 
    4747  $t->skip(); 
    4848} 
    49 catch (sfException $e) 
     49catch (InvalidArgumentException $e) 
    5050{ 
    51   $t->pass('__construct() throws an sfException if you pass some non existant options'); 
     51  $t->pass('__construct() throws an InvalidArgumentException if you pass some non existant options'); 
    5252  $t->like($e->getMessage(), '/ \'nonexistant\'/', 'The exception contains the non existant option names'); 
    5353} 
     
    6060{ 
    6161  new MyWidgetWithRequired(); 
    62   $t->fail('__construct() throws an sfException if you don\'t pass a required option'); 
     62  $t->fail('__construct() throws an RuntimeException if you don\'t pass a required option'); 
    6363} 
    64 catch (sfException $e) 
     64catch (RuntimeException $e) 
    6565{ 
    66   $t->pass('__construct() throws an sfException if you don\'t pass a required option'); 
     66  $t->pass('__construct() throws an RuntimeException if you don\'t pass a required option'); 
    6767} 
    6868 
     
    7979{ 
    8080  $w->setOption('foobar', 'foo'); 
    81   $t->fail('->setOption() throws an sfException if the option is not registered'); 
     81  $t->fail('->setOption() throws an InvalidArgumentException if the option is not registered'); 
    8282} 
    83 catch (sfException $e) 
     83catch (InvalidArgumentException $e) 
    8484{ 
    85   $t->pass('->setOption() throws an sfException if the option is not registered'); 
     85  $t->pass('->setOption() throws an InvalidArgumentException if the option is not registered'); 
    8686} 
    8787