Changeset 6198
- Timestamp:
- 11/28/07 09:00:45 (1 year ago)
- Files:
-
- branches/dwhittle/lib/form/sfForm.class.php (modified) (2 diffs)
- branches/dwhittle/lib/form/sfFormField.class.php (modified) (7 diffs)
- branches/dwhittle/lib/validator/sfValidator.class.php (modified) (5 diffs)
- branches/dwhittle/lib/validator/sfValidatorAll.class.php (modified) (1 diff)
- branches/dwhittle/lib/validator/sfValidatorAny.class.php (modified) (1 diff)
- branches/dwhittle/lib/validator/sfValidatorDecorator.class.php (modified) (1 diff)
- branches/dwhittle/lib/validator/sfValidatorErrorSchema.class.php (modified) (2 diffs)
- branches/dwhittle/lib/validator/sfValidatorFromDescription.class.php (modified) (3 diffs)
- branches/dwhittle/lib/validator/sfValidatorSchema.class.php (modified) (4 diffs)
- branches/dwhittle/lib/validator/sfValidatorSchemaCompare.class.php (modified) (1 diff)
- branches/dwhittle/lib/validator/sfValidatorSchemaFilter.class.php (modified) (1 diff)
- branches/dwhittle/lib/validator/sfValidatorSchemaForEach.class.php (modified) (1 diff)
- branches/dwhittle/lib/widget/sfWidget.class.php (modified) (3 diffs)
- branches/dwhittle/lib/widget/sfWidgetFormDateTime.class.php (modified) (1 diff)
- branches/dwhittle/lib/widget/sfWidgetFormSchema.class.php (modified) (12 diffs)
- branches/dwhittle/test/unit/form/sfFormFieldTest.php (modified) (8 diffs)
- branches/dwhittle/test/unit/form/sfFormTest.php (modified) (2 diffs)
- branches/dwhittle/test/unit/validator/sfValidatorAllTest.php (modified) (1 diff)
- branches/dwhittle/test/unit/validator/sfValidatorAnyTest.php (modified) (1 diff)
- branches/dwhittle/test/unit/validator/sfValidatorCSRFTokenTest.php (modified) (1 diff)
- branches/dwhittle/test/unit/validator/sfValidatorCallbackTest.php (modified) (1 diff)
- branches/dwhittle/test/unit/validator/sfValidatorChoiceTest.php (modified) (1 diff)
- branches/dwhittle/test/unit/validator/sfValidatorDecoratorTest.php (modified) (1 diff)
- branches/dwhittle/test/unit/validator/sfValidatorErrorSchemaTest.php (modified) (1 diff)
- branches/dwhittle/test/unit/validator/sfValidatorRegexTest.php (modified) (1 diff)
- branches/dwhittle/test/unit/validator/sfValidatorSchemaCompareTest.php (modified) (1 diff)
- branches/dwhittle/test/unit/validator/sfValidatorSchemaFilterTest.php (modified) (1 diff)
- branches/dwhittle/test/unit/validator/sfValidatorSchemaTest.php (modified) (3 diffs)
- branches/dwhittle/test/unit/validator/sfValidatorTest.php (modified) (5 diffs)
- branches/dwhittle/test/unit/widget/sfWidgetFormDateTimeTest.php (modified) (1 diff)
- branches/dwhittle/test/unit/widget/sfWidgetFormSchemaDecoratorTest.php (modified) (1 diff)
- branches/dwhittle/test/unit/widget/sfWidgetFormSchemaTest.php (modified) (8 diffs)
- branches/dwhittle/test/unit/widget/sfWidgetFormSelectTest.php (modified) (1 diff)
- branches/dwhittle/test/unit/widget/sfWidgetTest.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/dwhittle/lib/form/sfForm.class.php
r6159 r6198 500 500 if (!$widget = $this->widgetSchema[$name]) 501 501 { 502 throw new sfException(sprintf('Widget "%s" does not exist.', $name));502 throw new InvalidArgumentException(sprintf('Widget "%s" does not exist.', $name)); 503 503 } 504 504 … … 517 517 * @param string (ignored) 518 518 * 519 * @throws <b> sfException</b>519 * @throws <b>LogicException</b> 520 520 */ 521 521 public function offsetSet($offset, $value) 522 522 { 523 throw new sfException('Cannot update form fields.');523 throw new LogicException('Cannot update form fields.'); 524 524 } 525 525 branches/dwhittle/lib/form/sfFormField.class.php
r6122 r6198 82 82 if ($this->widget instanceof sfWidgetFormSchema) 83 83 { 84 throw new sfException('Unable to format a row on a sfWidgetFormSchema.');84 throw new LogicException('Unable to format a row on a sfWidgetFormSchema.'); 85 85 } 86 86 … … 103 103 if ($this->widget instanceof sfWidgetFormSchema) 104 104 { 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.'); 106 106 } 107 107 … … 118 118 if ($this->widget instanceof sfWidgetFormSchema) 119 119 { 120 throw new sfException('Unable to render a label on a sfWidgetFormSchema.');120 throw new LogicException('Unable to render a label on a sfWidgetFormSchema.'); 121 121 } 122 122 … … 133 133 if ($this->widget instanceof sfWidgetFormSchema) 134 134 { 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.'); 136 136 } 137 137 … … 224 224 if (!$this->widget instanceof sfWidgetFormSchema) 225 225 { 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))); 227 227 } 228 228 229 229 if (is_null($widget = $this->widget[$name])) 230 230 { 231 throw new sfException(sprintf('Widget "%s" does not exist.', $name));231 throw new InvalidArgumentException(sprintf('Widget "%s" does not exist.', $name)); 232 232 } 233 233 … … 244 244 * @param string (ignored) 245 245 * 246 * @throws <b> sfException</b>246 * @throws <b>LogicException</b> 247 247 */ 248 248 public function offsetSet($offset, $value) 249 249 { 250 throw new sfException('Cannot update form fields (read-only).');250 throw new LogicException('Cannot update form fields (read-only).'); 251 251 } 252 252 … … 256 256 * @param string (ignored) 257 257 * 258 * @throws sfException258 * @throws LogicException 259 259 */ 260 260 public function offsetUnset($offset) 261 261 { 262 throw new sfException('Cannot remove form fields (read-only).');262 throw new LogicException('Cannot remove form fields (read-only).'); 263 263 } 264 264 } branches/dwhittle/lib/validator/sfValidator.class.php
r5895 r6198 61 61 if ($diff = array_diff(array_keys($options), array_merge(array_keys($this->options), $this->requiredOptions))) 62 62 { 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))); 64 64 } 65 65 … … 67 67 if ($diff = array_diff(array_keys($messages), array_keys($this->messages))) 68 68 { 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))); 70 70 } 71 71 … … 73 73 if ($diff = array_diff($this->requiredOptions, array_merge(array_keys($this->options), array_keys($options)))) 74 74 { 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))); 76 76 } 77 77 … … 132 132 if (!in_array($name, array_keys($this->messages))) 133 133 { 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)); 135 135 } 136 136 … … 191 191 if (!in_array($name, array_merge(array_keys($this->options), $this->requiredOptions))) 192 192 { 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)); 194 194 } 195 195 branches/dwhittle/lib/validator/sfValidatorAll.class.php
r5821 r6198 52 52 else if (!is_null($validators)) 53 53 { 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.'); 55 55 } 56 56 branches/dwhittle/lib/validator/sfValidatorAny.class.php
r5821 r6198 52 52 else if (!is_null($validators)) 53 53 { 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.'); 55 55 } 56 56 branches/dwhittle/lib/validator/sfValidatorDecorator.class.php
r5821 r6198 35 35 if (!$this->validator instanceof sfValidator) 36 36 { 37 throw new sfException('The getValidator() method must return a sfValidator instance.');37 throw new RuntimeException('The getValidator() method must return a sfValidator instance.'); 38 38 } 39 39 branches/dwhittle/lib/validator/sfValidatorErrorSchema.class.php
r5582 r6198 228 228 * @param string (ignored) 229 229 * 230 * @throws <b> sfException</b>230 * @throws <b>LogicException</b> 231 231 */ 232 232 public function offsetSet($offset, $value) 233 233 { 234 throw new sfException('Unable update an error.');234 throw new LogicException('Unable update an error.'); 235 235 } 236 236 … … 239 239 * 240 240 * @param string (ignored) 241 *242 * @throws sfException243 241 */ 244 242 public function offsetUnset($offset) branches/dwhittle/lib/validator/sfValidatorFromDescription.class.php
r5758 r6198 89 89 if (!preg_match('/\s*([a-z0-9_\-]+)/', substr($string, $i), $match)) 90 90 { 91 throw new sfException('Parsing problem.');91 throw new DomainException('Parsing problem.'); 92 92 } 93 93 … … 138 138 else 139 139 { 140 throw new sfException(sprintf('Unable to parse string (%s).', $string));140 throw new DomainException(sprintf('Unable to parse string (%s).', $string)); 141 141 } 142 142 } … … 238 238 if ($token instanceof sfValidatorFDTokenLeftBracket || $token instanceof sfValidatorFDTokenRightBracket) 239 239 { 240 throw new sfException(sprintf('Uneven parenthesis in string (%s).', $this->string));240 throw new DomainException(sprintf('Uneven parenthesis in string (%s).', $this->string)); 241 241 } 242 242 branches/dwhittle/lib/validator/sfValidatorSchema.class.php
r5969 r6198 49 49 else if (!is_null($fields)) 50 50 { 51 throw new sfException('sfValidatorSchema constructor takes an array of sfValidator objects.');51 throw new InvalidArgumentException('sfValidatorSchema constructor takes an array of sfValidator objects.'); 52 52 } 53 53 … … 100 100 if (!is_array($values)) 101 101 { 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'); 103 103 } 104 104 … … 227 227 if (!$validator instanceof sfValidator) 228 228 { 229 throw new sfException('A field must be an instance of sfValidator.');229 throw new InvalidArgumentException('A field must be an instance of sfValidator.'); 230 230 } 231 231 … … 258 258 public function asString($indent = 0) 259 259 { 260 throw new sfException('Unable to convert a sfValidatorSchema to string.');260 throw new Exception('Unable to convert a sfValidatorSchema to string.'); 261 261 } 262 262 } branches/dwhittle/lib/validator/sfValidatorSchemaCompare.class.php
r5895 r6198 67 67 if (!is_array($values)) 68 68 { 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'); 70 70 } 71 71 branches/dwhittle/lib/validator/sfValidatorSchemaFilter.class.php
r5895 r6198 49 49 if (!is_array($values)) 50 50 { 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'); 52 52 } 53 53 branches/dwhittle/lib/validator/sfValidatorSchemaForEach.class.php
r5758 r6198 47 47 public function asString($indent = 0) 48 48 { 49 throw new sfException('Unable to convert a sfValidatorSchemaForEach to string.');49 throw new Exception('Unable to convert a sfValidatorSchemaForEach to string.'); 50 50 } 51 51 } branches/dwhittle/lib/widget/sfWidget.class.php
r6159 r6198 41 41 if ($diff = array_diff(array_keys($options), array_merge(array_keys($this->options), $this->requiredOptions))) 42 42 { 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))); 44 44 } 45 45 … … 47 47 if ($diff = array_diff($this->requiredOptions, array_merge(array_keys($this->options), array_keys($options)))) 48 48 { 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))); 50 50 } 51 51 … … 128 128 if (!in_array($name, array_merge(array_keys($this->options), $this->requiredOptions))) 129 129 { 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)); 131 131 } 132 132 branches/dwhittle/lib/widget/sfWidgetFormDateTime.class.php
r5969 r6198 75 75 if (!is_array($options)) 76 76 { 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)); 78 78 } 79 79 branches/dwhittle/lib/widget/sfWidgetFormSchema.class.php
r5999 r6198 67 67 else if (!is_null($fields)) 68 68 { 69 throw new sfException('sfWidgetFormSchema constructor takes an array of sfWidget objects.');69 throw new InvalidArgumentException('sfWidgetFormSchema constructor takes an array of sfWidget objects.'); 70 70 } 71 71 … … 124 124 * @return sfWidgetFormSchemaFormatter sfWidgetFormSchemaFormatter instance 125 125 * 126 * @throws sfException126 * @throws InvalidArgumentException 127 127 */ 128 128 public function getFormFormatter() … … 141 141 } 142 142 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)); 144 144 } 145 145 … … 280 280 if (is_null($widget = $this[$name])) 281 281 { 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)); 283 283 } 284 284 … … 309 309 if (!is_array($values) && !$values instanceof ArrayAccess) 310 310 { 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'); 312 312 } 313 313 … … 460 460 if (!$widget instanceof sfWidget) 461 461 { 462 throw new sfException('A field must be an instance of sfWidget.');462 throw new InvalidArgumentException('A field must be an instance of sfWidget.'); 463 463 } 464 464 … … 519 519 if (array_diff($positions, array_keys($this->fields)) || array_diff(array_keys($this->fields), $positions)) 520 520 { 521 throw new sfException('Positions must contains all field names.');521 throw new InvalidArgumentException('Positions must contains all field names.'); 522 522 } 523 523 … … 543 543 if (false === $fieldPosition = array_search($field, $this->positions)) 544 544 { 545 throw new sfException(sprintf('Field "%s" does not exist.', $field));545 throw new InvalidArgumentException(sprintf('Field "%s" does not exist.', $field)); 546 546 } 547 547 unset($this->positions[$fieldPosition]); … … 552 552 if (false === $pivotPosition = array_search($pivot, $this->positions)) 553 553 { 554 throw new sfException(sprintf('Field "%s" does not exist.', $pivot));554 throw new InvalidArgumentException(sprintf('Field "%s" does not exist.', $pivot)); 555 555 } 556 556 } … … 567 567 if (is_null($pivot)) 568 568 { 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)); 570 570 } 571 571 $this->positions = array_merge( … … 578 578 if (is_null($pivot)) 579 579 { 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)); 581 581 } 582 582 $this->positions = array_merge( … … 587 587 break; 588 588 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)); 590 590 } 591 591 } branches/dwhittle/test/unit/form/sfFormFieldTest.php
r6122 r6198 33 33 $t->fail('sfFormField implements the ArrayAccess interface but in read-only mode'); 34 34 } 35 catch ( sfException $e)35 catch (LogicException $e) 36 36 { 37 37 $t->pass('sfFormField implements the ArrayAccess interface but in read-only mode'); … … 43 43 $t->fail('sfFormField implements the ArrayAccess interface but in read-only mode'); 44 44 } 45 catch ( sfException $e)45 catch (LogicException $e) 46 46 { 47 47 $t->pass('sfFormField implements the ArrayAccess interface but in read-only mode'); … … 53 53 $t->fail('sfFormField implements the ArrayAccess interface but in read-only mode'); 54 54 } 55 catch ( sfException $e)55 catch (LogicException $e) 56 56 { 57 57 $t->pass('sfFormField implements the ArrayAccess interface but in read-only mode'); … … 63 63 $t->fail('sfFormField implements the ArrayAccess interface but in read-only mode'); 64 64 } 65 catch ( sfException $e)65 catch (LogicException $e) 66 66 { 67 67 $t->pass('sfFormField implements the ArrayAccess interface but in read-only mode'); … … 117 117 { 118 118 $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'); 120 120 } 121 catch ( sfException $e)121 catch (LogicException $e) 122 122 { 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'); 124 124 } 125 125 … … 136 136 { 137 137 $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'); 139 139 } 140 catch ( sfException $e)140 catch (LogicException $e) 141 141 { 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'); 143 143 } 144 144 … … 149 149 { 150 150 $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'); 152 152 } 153 catch ( sfException $e)153 catch (LogicException $e) 154 154 { 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'); 156 156 } 157 157 … … 162 162 { 163 163 $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'); 165 165 } 166 catch ( sfException $e)166 catch (LogicException $e) 167 167 { 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'); 169 169 } 170 170 branches/dwhittle/test/unit/form/sfFormTest.php
r6122 r6198 115 115 $t->fail('sfForm ArrayAccess implementation does not permit to set a form field'); 116 116 } 117 catch ( sfException $e)117 catch (LogicException $e) 118 118 { 119 119 $t->pass('sfForm ArrayAccess implementation does not permit to set a form field'); … … 129 129 { 130 130 $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 } 133 catch (LogicException $e) 134 { 135 $t->pass('sfForm ArrayAccess implementation throws a LogicException if the form field does not exist'); 136 136 } 137 137 branches/dwhittle/test/unit/validator/sfValidatorAllTest.php
r5758 r6198 31 31 $t->fail('__construct() throws an exception when passing a non supported first argument'); 32 32 } 33 catch ( sfException $e)33 catch (InvalidArgumentException $e) 34 34 { 35 35 $t->pass('__construct() throws an exception when passing a non supported first argument'); branches/dwhittle/test/unit/validator/sfValidatorAnyTest.php
r5758 r6198 31 31 $t->fail('_construct() throws an exception when passing a non supported first argument'); 32 32 } 33 catch ( sfException $e)33 catch (InvalidArgumentException $e) 34 34 { 35 35 $t->pass('_construct() throws an exception when passing a non supported first argument'); branches/dwhittle/test/unit/validator/sfValidatorCSRFTokenTest.php
r6030 r6198 18 18 { 19 19 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'); 21 21 } 22 catch ( sfException $e)22 catch (RuntimeException $e) 23 23 { 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'); 25 25 } 26 26 branches/dwhittle/test/unit/validator/sfValidatorCallbackTest.php
r5758 r6198 28 28 { 29 29 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'); 31 31 } 32 catch ( sfException $e)32 catch (RuntimeException $e) 33 33 { 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'); 35 35 } 36 36 branches/dwhittle/test/unit/validator/sfValidatorChoiceTest.php
r5821 r6198 23 23 { 24 24 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'); 26 26 } 27 catch ( sfException $e)27 catch (RuntimeException $e) 28 28 { 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'); 30 30 } 31 31 branches/dwhittle/test/unit/validator/sfValidatorDecoratorTest.php
r5821 r6198 111 111 { 112 112 $v = new FakeValidator(); 113 $t->fail('->clean() throws a sfValidatorErrorif getValidator() does not return a sfValidator instance');113 $t->fail('->clean() throws a RuntimeException if getValidator() does not return a sfValidator instance'); 114 114 } 115 catch ( sfException $e)115 catch (RuntimeException $e) 116 116 { 117 $t->pass('->clean() throws a sfValidatorErrorif getValidator() does not return a sfValidator instance');117 $t->pass('->clean() throws a RuntimeException if getValidator() does not return a sfValidator instance'); 118 118 } branches/dwhittle/test/unit/validator/sfValidatorErrorSchemaTest.php
r5582 r6198 92 92 $t->fail('sfValidatorErrorSchema implements the ArrayAccess interface'); 93 93 } 94 catch ( sfException $e)94 catch (LogicException $e) 95 95 { 96 96 $t->pass('sfValidatorErrorSchema implements the ArrayAccess interface'); branches/dwhittle/test/unit/validator/sfValidatorRegexTest.php
r5821 r6198 18 18 { 19 19 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'); 21 21 } 22 catch ( sfException $e)22 catch (RuntimeException $e) 23 23 { 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'); 25 25 } 26 26 branches/dwhittle/test/unit/validator/sfValidatorSchemaCompareTest.php
r5758 r6198 59 59 { 60 60 $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'); 62 62 } 63 catch ( sfException $e)63 catch (InvalidArgumentException $e) 64 64 { 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'); 66 66 } 67 67 branches/dwhittle/test/unit/validator/sfValidatorSchemaFilterTest.php
r5651 r6198 24 24 { 25 25 $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'); 27 27 } 28 catch ( sfException $e)28 catch (InvalidArgumentException $e) 29 29 { 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'); 31 31 } 32 32 branches/dwhittle/test/unit/validator/sfValidatorSchemaTest.php
r5969 r6198 59 59 { 60 60 $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 } 63 catch (InvalidArgumentException $e) 64 { 65 $t->pass('__construct() throws an InvalidArgumentException when passing a non supported first argument'); 66 66 } 67 67 … … 78 78 $t->fail('sfValidatorSchema implements the ArrayAccess interface for the fields'); 79 79 } 80 catch ( sfException $e)80 catch (InvalidArgumentException $e) 81 81 { 82 82 $t->pass('sfValidatorSchema implements the ArrayAccess interface for the fields'); … … 119 119 { 120 120 $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 } 123 catch (InvalidArgumentException $e) 124 { 125 $t->pass('->clean() throws an InvalidArgumentException exception if the first argument is not an array of value'); 126 126 } 127 127 branches/dwhittle/test/unit/validator/sfValidatorTest.php
r5895 r6198 54 54 { 55 55 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'); 57 57 $t->skip(); 58 58 } 59 catch ( sfException $e)60 { 61 $t->pass('__construct() throws an sfException if you pass some non existant options');59 catch (InvalidArgumentException $e) 60 { 61 $t->pass('__construct() throws an InvalidArgumentException if you pass some non existant options'); 62 62 $t->like($e->getMessage(), '/ \'nonexistant\', \'anothernonexistant\'/', 'The exception contains the non existant option names'); 63 63 } … … 66 66 { 67 67 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'); 69 69 $t->skip(); 70 70 } 71 catch ( sfException $e)72 { 73 $t->pass('__construct() throws an sfException if you pass some non existant error codes');71 catch (InvalidArgumentException $e) 72 { 73 $t->pass('__construct() throws an InvalidArgumentException if you pass some non existant error codes'); 74 74 $t->like($e->getMessage(), '/ \'nonexistant\', \'anothernonexistant\'/', 'The exception contains the non existant error codes'); 75 75 } … … 83 83 { 84 84 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 } 87 catch (RuntimeException $e) 88 { 89 $t->pass('__construct() throws an RuntimeException if you don\'t pass a required option'); 90 90 } 91 91 … … 122 122 { 123 123 $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 } 126 catch (InvalidArgumentException $e) 127 { 128 $t->pass('->setOption() throws an InvalidArgumentException if the option is not registered'); 129 129 } 130 130 … … 175 175 { 176 176 $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 } 179 catch (InvalidArgumentException $e) 180 { 181 $t->pass('->setMessage() throws an InvalidArgumentException if the message is not registered'); 182 182 } 183 183 branches/dwhittle/test/unit/widget/sfWidgetFormDateTimeTest.php
r6189 r6198 93 93 { 94 94 $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'); 96 96 } 97 catch ( sfException $e)97 catch (InvalidArgumentException $e) 98 98 { 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'); 100 100 } branches/dwhittle/test/unit/widget/sfWidgetFormSchemaDecoratorTest.php
r5943 r6198 42 42 $t->fail('sfWidgetFormSchemaDecorator implements the ArrayAccess interface for the fields');