Changeset 67
- Timestamp:
- 01/15/07 17:17:02 (2 years ago)
- Files:
-
- trunk/src/main/php/helper/validators/stubAbstractCompositeValidator.php (modified) (1 diff)
- trunk/src/main/php/helper/validators/stubXorValidator.php (modified) (1 diff)
- trunk/src/test/php/helper/validators/stubAndValidatorTestCase.php (modified) (2 diffs)
- trunk/src/test/php/helper/validators/stubOrValidatorTestCase.php (modified) (2 diffs)
- trunk/src/test/php/helper/validators/stubXorValidatorTestCase.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/src/main/php/helper/validators/stubAbstractCompositeValidator.php
r65 r67 45 45 throw new stubValidatorException('No validators set for composite ' . __CLASS__); 46 46 } 47 48 return $this->validateReal($value); 47 49 } 48 50 trunk/src/main/php/helper/validators/stubXorValidator.php
r52 r67 34 34 } 35 35 36 if (0 == $trueCount) { 37 return false; 38 } 39 36 40 return true; 37 41 } trunk/src/test/php/helper/validators/stubAndValidatorTestCase.php
r52 r67 37 37 public function testValidation() 38 38 { 39 $this->expectException('stubValidatorException'); 40 $this->andValidator->validate('foo'); 41 $mockValidator1 = new MockstubValidator(); 39 $mockValidator1 = new MockstubValidator(); 42 40 $mockValidator1->setReturnValue('validate', true); 43 41 $this->andValidator->addValidator($mockValidator1); … … 47 45 $this->andValidator->addValidator($mockValidator2); 48 46 $this->assertFalse($this->andValidator->validate('foo')); 47 } 48 49 /** 50 * assure that validation works correct 51 */ 52 public function testValidationException() 53 { 54 $this->expectException('stubValidatorException'); 55 $this->andValidator->validate('foo'); 49 56 } 50 57 trunk/src/test/php/helper/validators/stubOrValidatorTestCase.php
r52 r67 37 37 public function testValidation() 38 38 { 39 $this->expectException('stubValidatorException');40 $this->orValidator->validate('foo');41 39 $mockValidator1 = new MockstubValidator(); 42 40 $mockValidator1->setReturnValue('validate', false); … … 48 46 $this->orValidator->addValidator($mockValidator2); 49 47 $this->assertTrue($this->orValidator->validate('foo')); 48 } 49 50 /** 51 * assure that validation works correct 52 */ 53 public function testValidationException() 54 { 55 $this->expectException('stubValidatorException'); 56 $this->orValidator->validate('foo'); 50 57 } 51 58 trunk/src/test/php/helper/validators/stubXorValidatorTestCase.php
r52 r67 37 37 public function testValidation() 38 38 { 39 $this->expectException('stubValidatorException');40 $this->xorValidator->validate('foo');41 39 $mockValidator1 = new MockstubValidator(); 42 40 $mockValidator1->setReturnValue('validate', false); … … 59 57 $this->assertFalse($this->xorValidator->validate('foo')); 60 58 } 59 60 /** 61 * assure that validation works correct 62 */ 63 public function testValidationException() 64 { 65 $this->expectException('stubValidatorException'); 66 $this->xorValidator->validate('foo'); 67 } 68 61 69 62 70 /**
