Changeset 1326
- Timestamp:
- 02/03/08 22:00:06 (7 months ago)
- Files:
-
- trunk/src/main/php/net/stubbles/ipo/request/stubRequestValueError.php (modified) (3 diffs)
- trunk/src/main/php/net/stubbles/ipo/request/stubRequestValueErrorException.php (deleted)
- trunk/src/main/php/net/stubbles/ipo/request/stubRequestValueErrorFactory.php (modified) (1 diff)
- trunk/src/main/php/net/stubbles/ipo/request/stubRequestValueErrorFactoryMappingDecorator.php (modified) (1 diff)
- trunk/src/main/php/net/stubbles/ipo/request/stubRequestValueErrorXJConfFactory.php (modified) (5 diffs)
- trunk/src/test/php/net/stubbles/integration/stubRequestValueErrorXJConfFactoryTestCase.php (modified) (18 diffs)
- trunk/src/test/php/net/stubbles/ipo/request/stubRequestValueErrorTestCase.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/src/main/php/net/stubbles/ipo/request/stubRequestValueError.php
r1223 r1326 7 7 * @subpackage ipo_request 8 8 */ 9 stubClassLoader::load('net::stubbles:: ipo::request::stubRequestValueErrorException',10 'net::stubbles::lang:: stubClonable'9 stubClassLoader::load('net::stubbles::lang::stubClonable', 10 'net::stubbles::lang::exceptions::stubIllegalArgumentException' 11 11 ); 12 12 /** … … 153 153 * @param array<string,mixed> $values 154 154 * @return stubRequestValueError 155 * @throws stub RequestValueErrorException155 * @throws stubIllegalArgumentException 156 156 * @XMLIgnore 157 157 */ … … 160 160 foreach (array_keys($this->values) as $key) { 161 161 if (isset($values[$key]) === false) { 162 throw new stub RequestValueErrorException('Value for key ' . $key . ' is missing.');162 throw new stubIllegalArgumentException('Value for key ' . $key . ' is missing.'); 163 163 } 164 164 trunk/src/main/php/net/stubbles/ipo/request/stubRequestValueErrorFactory.php
r1223 r1326 21 21 * @param string $id id of RequestValueError to create 22 22 * @return stubRequestValueError 23 * @throws stubRequestValueErrorException24 23 */ 25 24 public function create($id); trunk/src/main/php/net/stubbles/ipo/request/stubRequestValueErrorFactoryMappingDecorator.php
r1223 r1326 67 67 * @param string $id id of RequestValueError to create 68 68 * @return stubRequestValueError 69 * @throws stubRequestValueErrorException70 69 */ 71 70 public function create($id) trunk/src/main/php/net/stubbles/ipo/request/stubRequestValueErrorXJConfFactory.php
r1312 r1326 8 8 */ 9 9 stubClassLoader::load('net::stubbles::ipo::request::stubRequestValueErrorFactory', 10 'net::stubbles::ipo::request::stubRequestValueErrorException', 10 'net::stubbles::lang::exceptions::stubConfigurationException', 11 'net::stubbles::lang::exceptions::stubIllegalArgumentException', 11 12 'net::stubbles::util::xjconf::xjconf' 12 13 ); … … 38 39 * constructor 39 40 * 40 * @throws stub RequestValueErrorException41 * @throws stubConfigurationException 41 42 */ 42 43 public function __construct() … … 51 52 $xjconf->process(stubFactory::getResourceURIs('ipo/request.xml')); 52 53 } catch (stubXJConfException $xjce) { 53 throw new stub RequestValueErrorException($xjce->getMessage());54 throw new stubConfigurationException($xjce->getMessage()); 54 55 } 55 56 } … … 102 103 * @param string $id id of RequestValueError to create 103 104 * @return stubRequestValueError 104 * @throws stub RequestValueErrorException105 * @throws stubIllegalArgumentException 105 106 */ 106 107 public function create($id) … … 110 111 } 111 112 112 throw new stub RequestValueErrorException('RequestValueError with id ' . $id . ' does not exist.');113 throw new stubIllegalArgumentException('RequestValueError with id ' . $id . ' does not exist.'); 113 114 } 114 115 } trunk/src/test/php/net/stubbles/integration/stubRequestValueErrorXJConfFactoryTestCase.php
r1312 r1326 40 40 $this->URL_INCORRECT($rveFactory); 41 41 $this->URL_NOT_AVAILABLE($rveFactory); 42 $this->invalidErrorId($rveFactory); 42 43 stubRequestValueErrorXJConfFactory::refresh(); 43 44 // cached … … 59 60 $this->URL_INCORRECT($rveFactory); 60 61 $this->URL_NOT_AVAILABLE($rveFactory); 62 $this->invalidErrorId($rveFactory); 61 63 } 62 64 63 65 /** 64 66 * test that the FIELD_EMPTY error is created 67 * 68 * @param stubRequestValueErrorFactory $rveFactory 65 69 */ 66 70 public function FIELD_EMPTY($rveFactory) … … 77 81 /** 78 82 * test that the FIELD_NO_SELECT error is created 83 * 84 * @param stubRequestValueErrorFactory $rveFactory 79 85 */ 80 86 public function FIELD_NO_SELECT($rveFactory) … … 91 97 /** 92 98 * test that the FIELD_WRONG_VALUE error is created 99 * 100 * @param stubRequestValueErrorFactory $rveFactory 93 101 */ 94 102 public function FIELD_WRONG_VALUE($rveFactory) … … 105 113 /** 106 114 * test that the VALUE_TOO_SMALL error is created 115 * 116 * @param stubRequestValueErrorFactory $rveFactory 107 117 */ 108 118 public function VALUE_TOO_SMALL($rveFactory) … … 119 129 /** 120 130 * test that the VALUE_TOO_GREAT error is created 131 * 132 * @param stubRequestValueErrorFactory $rveFactory 121 133 */ 122 134 public function VALUE_TOO_GREAT($rveFactory) … … 133 145 /** 134 146 * test that the PASSWORDS_NOT_EQUAL error is created 147 * 148 * @param stubRequestValueErrorFactory $rveFactory 135 149 */ 136 150 public function PASSWORDS_NOT_EQUAL($rveFactory) … … 147 161 /** 148 162 * test that the PASSWORD_INVALID error is created 163 * 164 * @param stubRequestValueErrorFactory $rveFactory 149 165 */ 150 166 public function PASSWORD_INVALID($rveFactory) … … 161 177 /** 162 178 * test that the PASSWORD_TOO_LESS_DIFF_CHARS error is created 179 * 180 * @param stubRequestValueErrorFactory $rveFactory 163 181 */ 164 182 public function PASSWORD_TOO_LESS_DIFF_CHARS($rveFactory) … … 175 193 /** 176 194 * test that the STRING_TOO_SHORT error is created 195 * 196 * @param stubRequestValueErrorFactory $rveFactory 177 197 */ 178 198 public function STRING_TOO_SHORT($rveFactory) … … 189 209 /** 190 210 * test that the STRING_TOO_LONG error is created 211 * 212 * @param stubRequestValueErrorFactory $rveFactory 191 213 */ 192 214 public function STRING_TOO_LONG($rveFactory) … … 203 225 /** 204 226 * test that the DATE_INVALID error is created 227 * 228 * @param stubRequestValueErrorFactory $rveFactory 205 229 */ 206 230 public function DATE_INVALID($rveFactory) … … 217 241 /** 218 242 * test that the DATE_TOO_EARLY error is created 243 * 244 * @param stubRequestValueErrorFactory $rveFactory 219 245 */ 220 246 public function DATE_TOO_EARLY($rveFactory) … … 231 257 /** 232 258 * test that the DATE_TOO_LATE error is created 259 * 260 * @param stubRequestValueErrorFactory $rveFactory 233 261 */ 234 262 public function DATE_TOO_LATE($rveFactory) … … 245 273 /** 246 274 * test that the MAILADDRESS_INCORRECT error is created 275 * 276 * @param stubRequestValueErrorFactory $rveFactory 247 277 */ 248 278 public function MAILADDRESS_INCORRECT($rveFactory) … … 259 289 /** 260 290 * test that the URL_INCORRECT error is created 291 * 292 * @param stubRequestValueErrorFactory $rveFactory 261 293 */ 262 294 public function URL_INCORRECT($rveFactory) … … 273 305 /** 274 306 * test that the URL_NOT_AVAILABLE error is created 307 * 308 * @param stubRequestValueErrorFactory $rveFactory 275 309 */ 276 310 public function URL_NOT_AVAILABLE($rveFactory) … … 283 317 $requestError2 = $rveFactory->create('URL_NOT_AVAILABLE'); 284 318 $this->assertNotSame($requestError, $requestError2); 319 } 320 321 /** 322 * test that trying to retrieve a non-existing error throws an exception 323 * 324 * @param stubRequestValueErrorFactory $rveFactory 325 */ 326 public function invalidErrorId($rveFactory) 327 { 328 try { 329 $rveFactory->create('invalid'); 330 } catch (stubIllegalArgumentException $iae) { 331 return; 332 } 333 334 $this->fail('Expected stubIllegalArgumentException, got none or another.'); 285 335 } 286 336 } trunk/src/test/php/net/stubbles/ipo/request/stubRequestValueErrorTestCase.php
r1273 r1326 129 129 * 130 130 * @test 131 * @expectedException stub RequestValueErrorException131 * @expectedException stubIllegalArgumentException 132 132 */ 133 133 public function setValues()
