Changeset 1116
- Timestamp:
- 12/05/07 18:59:15 (1 year ago)
- Files:
-
- trunk/src/main/php/net/stubbles/util/validators/stubAbstractCompositeValidator.php (modified) (2 diffs)
- trunk/src/main/php/net/stubbles/util/validators/stubContainsValidator.php (modified) (2 diffs)
- trunk/src/main/php/net/stubbles/util/validators/stubEqualValidator.php (modified) (2 diffs)
- trunk/src/main/php/net/stubbles/util/validators/stubValidator.php (modified) (2 diffs)
- trunk/src/main/php/net/stubbles/util/validators/stubValidatorException.php (deleted)
- trunk/src/test/php/net/stubbles/util/validators/stubAndValidatorTestCase.php (modified) (1 diff)
- trunk/src/test/php/net/stubbles/util/validators/stubContainsValidatorTestCase.php (modified) (2 diffs)
- trunk/src/test/php/net/stubbles/util/validators/stubEqualValidatorTestCase.php (modified) (1 diff)
- trunk/src/test/php/net/stubbles/util/validators/stubOrValidatorTestCase.php (modified) (1 diff)
- trunk/src/test/php/net/stubbles/util/validators/stubXorValidatorTestCase.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/src/main/php/net/stubbles/util/validators/stubAbstractCompositeValidator.php
r151 r1116 7 7 * @subpackage util_validators 8 8 */ 9 stubClassLoader::load('net.stubbles.util.validators.stubCompositeValidator'); 9 stubClassLoader::load('net.stubbles.lang.exceptions.stubRuntimeException', 10 'net.stubbles.util.validators.stubCompositeValidator' 11 ); 10 12 /** 11 13 * Base class for composite validators. … … 42 44 * @param mixed $value 43 45 * @return bool true if value is ok, else false 44 * @throws stubValidatorException45 46 */ 46 47 public function validate($value) 47 48 { 48 49 if (count($this->validators) == 0) { 49 throw new stub ValidatorException('No validators set for composite ' . __CLASS__);50 throw new stubRuntimeException('No validators set for composite ' . __CLASS__); 50 51 } 51 52 trunk/src/main/php/net/stubbles/util/validators/stubContainsValidator.php
r1103 r1116 7 7 * @subpackage util_validators 8 8 */ 9 stubClassLoader::load('net.stubbles.util.validators.stubValidator'); 9 stubClassLoader::load('net.stubbles.lang.exceptions.stubIllegalArgumentException', 10 'net.stubbles.util.validators.stubValidator' 11 ); 10 12 /** 11 13 * Class for validating that something is equal. … … 31 33 * 32 34 * @param scalar|null $contained 33 * @throws stubValidatorException34 35 */ 35 36 public function __construct($contained) 36 37 { 37 38 if (is_scalar($contained) == false) { 38 throw new stub ValidatorException('Can only check scalar values.');39 throw new stubIllegalArgumentException('Can only check scalar values.'); 39 40 } 40 41 trunk/src/main/php/net/stubbles/util/validators/stubEqualValidator.php
r370 r1116 7 7 * @subpackage util_validators 8 8 */ 9 stubClassLoader::load('net.stubbles.util.validators.stubValidator'); 9 stubClassLoader::load('net.stubbles.lang.exceptions.stubIllegalArgumentException', 10 'net.stubbles.util.validators.stubValidator' 11 ); 10 12 /** 11 13 * Class for validating that something is equal. … … 31 33 * 32 34 * @param scalar|null $expected 33 * @throws stubValidatorException34 35 */ 35 36 public function __construct($expected) 36 37 { 37 38 if (is_scalar($expected) == false && null != $expected) { 38 throw new stub ValidatorException('Can only compare scalar values and null.');39 throw new stubIllegalArgumentException('Can only compare scalar values and null.'); 39 40 } 40 41 trunk/src/main/php/net/stubbles/util/validators/stubValidator.php
r151 r1116 7 7 * @subpackage util_validators 8 8 */ 9 stubClassLoader::load('net.stubbles.util.validators.stubValidatorException');10 9 /** 11 10 * Interface for validators. … … 25 24 * @param mixed $value 26 25 * @return bool true if value is ok, else false 27 * @throws stubValidatorException28 26 */ 29 27 public function validate($value); trunk/src/test/php/net/stubbles/util/validators/stubAndValidatorTestCase.php
r696 r1116 52 52 public function testValidationException() 53 53 { 54 $this->expectException('stub ValidatorException');54 $this->expectException('stubRuntimeException'); 55 55 $this->andValidator->validate('foo'); 56 56 } trunk/src/test/php/net/stubbles/util/validators/stubContainsValidatorTestCase.php
r1103 r1116 26 26 $containsValidator = new stubContainsValidator(false); 27 27 28 $this->expectException('stub ValidatorException');28 $this->expectException('stubIllegalArgumentException'); 29 29 $containsValidator = new stubContainsValidator(new stdClass()); 30 30 } … … 35 35 public function testConstructionWithNull() 36 36 { 37 $this->expectException('stub ValidatorException');37 $this->expectException('stubIllegalArgumentException'); 38 38 $containsValidator = new stubContainsValidator(null); 39 39 } trunk/src/test/php/net/stubbles/util/validators/stubEqualValidatorTestCase.php
r371 r1116 27 27 $equalValidator = new stubEqualValidator(null); 28 28 29 $this->expectException('stub ValidatorException');29 $this->expectException('stubIllegalArgumentException'); 30 30 $this->equalValidator = new stubEqualValidator(new stdClass()); 31 31 } trunk/src/test/php/net/stubbles/util/validators/stubOrValidatorTestCase.php
r696 r1116 53 53 public function testValidationException() 54 54 { 55 $this->expectException('stub ValidatorException');55 $this->expectException('stubRuntimeException'); 56 56 $this->orValidator->validate('foo'); 57 57 } trunk/src/test/php/net/stubbles/util/validators/stubXorValidatorTestCase.php
r696 r1116 63 63 public function testValidationException() 64 64 { 65 $this->expectException('stub ValidatorException');65 $this->expectException('stubRuntimeException'); 66 66 $this->xorValidator->validate('foo'); 67 67 }
