Changeset 6197
- Timestamp:
- 11/28/07 08:50:09 (9 months ago)
- Files:
-
- trunk/test/unit/form/sfFormFieldTest.php (modified) (8 diffs)
- trunk/test/unit/form/sfFormTest.php (modified) (2 diffs)
- trunk/test/unit/validator/sfValidatorAllTest.php (modified) (1 diff)
- trunk/test/unit/validator/sfValidatorAnyTest.php (modified) (1 diff)
- trunk/test/unit/validator/sfValidatorCSRFTokenTest.php (modified) (1 diff)
- trunk/test/unit/validator/sfValidatorCallbackTest.php (modified) (1 diff)
- trunk/test/unit/validator/sfValidatorChoiceTest.php (modified) (1 diff)
- trunk/test/unit/validator/sfValidatorDecoratorTest.php (modified) (1 diff)
- trunk/test/unit/validator/sfValidatorErrorSchemaTest.php (modified) (1 diff)
- trunk/test/unit/validator/sfValidatorRegexTest.php (modified) (1 diff)
- trunk/test/unit/validator/sfValidatorSchemaCompareTest.php (modified) (1 diff)
- trunk/test/unit/validator/sfValidatorSchemaFilterTest.php (modified) (1 diff)
- trunk/test/unit/validator/sfValidatorSchemaTest.php (modified) (3 diffs)
- trunk/test/unit/validator/sfValidatorTest.php (modified) (5 diffs)
- trunk/test/unit/widget/sfWidgetFormDateTimeTest.php (modified) (1 diff)
- trunk/test/unit/widget/sfWidgetFormSchemaDecoratorTest.php (modified) (1 diff)
- trunk/test/unit/widget/sfWidgetFormSchemaTest.php (modified) (8 diffs)
- trunk/test/unit/widget/sfWidgetFormSelectTest.php (modified) (1 diff)
- trunk/test/unit/widget/sfWidgetTest.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/test/unit/form/sfFormFieldTest.php
r6115 r6197 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 trunk/test/unit/form/sfFormTest.php
r6114 r6197 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 trunk/test/unit/validator/sfValidatorAllTest.php
r5753 r6197 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'); trunk/test/unit/validator/sfValidatorAnyTest.php
r5753 r6197 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'); trunk/test/unit/validator/sfValidatorCSRFTokenTest.php
r6022 r6197 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 trunk/test/unit/validator/sfValidatorCallbackTest.php
r5753 r6197 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 trunk/test/unit/validator/sfValidatorChoiceTest.php
r5819 r6197 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 trunk/test/unit/validator/sfValidatorDecoratorTest.php
r5816 r6197 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 } trunk/test/unit/validator/sfValidatorErrorSchemaTest.php
r5581 r6197 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'); trunk/test/unit/validator/sfValidatorRegexTest.php
r5816 r6197 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 trunk/test/unit/validator/sfValidatorSchemaCompareTest.php
r5753 r6197 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 trunk/test/unit/validator/sfValidatorSchemaFilterTest.php
r5638 r6197 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 trunk/test/unit/validator/sfValidatorSchemaTest.php
r5949 r6197 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 trunk/test/unit/validator/sfValidatorTest.php
r5882 r6197 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 trunk/test/unit/widget/sfWidgetFormDateTimeTest.php
r5950 r6197 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 } trunk/test/unit/widget/sfWidgetFormSchemaDecoratorTest.php
r5937 r6197 42 42 $t->fail('sfWidgetFormSchemaDecorator implements the ArrayAccess interface for the fields'); 43 43 } 44 catch ( sfException $e)44 catch (LogicException $e) 45 45 { 46 46 $t->pass('sfWidgetFormSchemaDecorator implements the ArrayAccess interface for the fields'); trunk/test/unit/widget/sfWidgetFormSchemaTest.php
r5996 r6197 27 27 $t->fail('__construct() throws a exception when passing a non supported first argument'); 28 28 } 29 catch ( sfException $e)29 catch (InvalidArgumentException $e) 30 30 { 31 31 $t->pass('__construct() throws an exception when passing a non supported first argument'); … … 52 52 $t->fail('sfWidgetFormSchema implements the ArrayAccess interface for the fields'); 53 53 } 54 catch ( sfException $e)54 catch (LogicException $e) 55 55 { 56 56 $t->pass('sfWidgetFormSchema implements the ArrayAccess interface for the fields'); … … 86 86 { 87 87 $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 } 90 catch (InvalidArgumentException $e) 91 { 92 $t->pass('->setFormFormatterName() throws a InvalidArgumentException when the form format name is not associated with a formatter'); 93 93 } 94 94 … … 151 151 { 152 152 $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 } 155 catch (InvalidArgumentException $e) 156 { 157 $t->pass('->renderField() throws an InvalidArgumentException if the field does not exist'); 158 158 } 159 159 … … 177 177 { 178 178 $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 } 181 catch (InvalidArgumentException $e) 182 { 183 $t->pass('->setPositions() throws an InvalidArgumentException if you give it a non existant field name'); 184 184 } 185 185 … … 187 187 { 188 188 $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 } 191 catch (InvalidArgumentException $e) 192 { 193 $t->pass('->setPositions() throws an InvalidArgumentException if you miss a field name'); 194 194 } 195 195 … … 212 212 { 213 213 $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 } 216 catch (LogicException $e) 217 { 218 $t->pass('->moveField() throws an LogicException if you don\'t pass a relative field name with AFTER'); 219 219 } 220 220 try 221 221 { 222 222 $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 } 225 catch (LogicException $e) 226 { 227 $t->pass('->moveField() throws an LogicException if you don\'t pass a relative field name with BEFORE'); 228 228 } 229 229 … … 235 235 { 236 236 $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 } 239 catch (InvalidArgumentException $e) 240 { 241 $t->pass('->render() throws an InvalidArgumentException if the second argument is not an array'); 242 242 } 243 243 trunk/test/unit/widget/sfWidgetFormSelectTest.php
r5937 r6197 50 50 { 51 51 $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'); 53 53 } 54 catch ( sfException $e)54 catch (RuntimeException $e) 55 55 { 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'); 57 57 } 58 58 trunk/test/unit/widget/sfWidgetTest.php
r5937 r6197 44 44 { 45 45 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'); 47 47 $t->skip(); 48 48 } 49 catch ( sfException $e)49 catch (InvalidArgumentException $e) 50 50 { 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'); 52 52 $t->like($e->getMessage(), '/ \'nonexistant\'/', 'The exception contains the non existant option names'); 53 53 } … … 60 60 { 61 61 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'); 63 63 } 64 catch ( sfException $e)64 catch (RuntimeException $e) 65 65 { 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'); 67 67 } 68 68 … … 79 79 { 80 80 $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'); 82 82 } 83 catch ( sfException $e)83 catch (InvalidArgumentException $e) 84 84 { 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'); 86 86 } 87 87