Changeset 1490
- Timestamp:
- 04/04/08 11:12:15 (4 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/src/main/php/net/stubbles/util/validators/stubXorValidator.php
r1230 r1490 34 34 $trueCount = 0; 35 35 foreach ($this->validators as $validator) { 36 if ($validator->validate($value) == false) { 37 continue; 38 } 39 40 $trueCount++; 41 if (1 < $trueCount) { 42 // more than one true received, 43 // can not return with true any more 44 return false; 36 if ($validator->validate($value) === true) { 37 $trueCount++; 38 if (1 < $trueCount) { 39 // more than one true received, 40 // can not return with true any more 41 return false; 42 } 45 43 } 46 44 } trunk/src/test/php/net/stubbles/util/validators/stubExtFilterValidatorTestCase.php
r1291 r1490 57 57 $this->assertFalse($validator->validate('no int')); 58 58 } 59 60 /** 61 * ext validator has no specific criteria 62 * 63 * @test 64 */ 65 public function criteria() 66 { 67 $validator = new stubExtFilterValidator(FILTER_VALIDATE_INT, array(), FILTER_FLAG_ALLOW_HEX); 68 $this->assertEquals(array(), $validator->getCriteria()); 69 } 59 70 } 60 71 ?> trunk/src/test/php/net/stubbles/util/validators/stubIpValidatorTestCase.php
r1291 r1490 69 69 $this->assertTrue($this->ipValidator->validate('1.2.3.4')); 70 70 } 71 72 /** 73 * ip validator has no specific criteria 74 * 75 * @test 76 */ 77 public function criteria() 78 { 79 $this->assertEquals(array(), $this->ipValidator->getCriteria()); 80 } 71 81 } 72 82 ?>
