Changeset 67

Show
Ignore:
Timestamp:
01/15/07 17:17:02 (2 years ago)
Author:
mikey
Message:

bugfix: validateReal() was never called

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/src/main/php/helper/validators/stubAbstractCompositeValidator.php

    r65 r67  
    4545            throw new stubValidatorException('No validators set for composite ' . __CLASS__); 
    4646        } 
     47         
     48        return $this->validateReal($value); 
    4749    } 
    4850     
  • trunk/src/main/php/helper/validators/stubXorValidator.php

    r52 r67  
    3434        } 
    3535         
     36        if (0 == $trueCount) { 
     37            return false; 
     38        } 
     39         
    3640        return true; 
    3741    } 
  • trunk/src/test/php/helper/validators/stubAndValidatorTestCase.php

    r52 r67  
    3737    public function testValidation() 
    3838    { 
    39         $this->expectException('stubValidatorException'); 
    40         $this->andValidator->validate('foo'); 
    41         $mockValidator1 = new MockstubValidator(); 
     39        $mockValidator1 = new MockstubValidator(); 
    4240        $mockValidator1->setReturnValue('validate', true); 
    4341        $this->andValidator->addValidator($mockValidator1); 
     
    4745        $this->andValidator->addValidator($mockValidator2); 
    4846        $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'); 
    4956    } 
    5057 
  • trunk/src/test/php/helper/validators/stubOrValidatorTestCase.php

    r52 r67  
    3737    public function testValidation() 
    3838    { 
    39         $this->expectException('stubValidatorException'); 
    40         $this->orValidator->validate('foo'); 
    4139        $mockValidator1 = new MockstubValidator(); 
    4240        $mockValidator1->setReturnValue('validate', false); 
     
    4846        $this->orValidator->addValidator($mockValidator2); 
    4947        $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'); 
    5057    } 
    5158 
  • trunk/src/test/php/helper/validators/stubXorValidatorTestCase.php

    r52 r67  
    3737    public function testValidation() 
    3838    { 
    39         $this->expectException('stubValidatorException'); 
    40         $this->xorValidator->validate('foo'); 
    4139        $mockValidator1 = new MockstubValidator(); 
    4240        $mockValidator1->setReturnValue('validate', false); 
     
    5957        $this->assertFalse($this->xorValidator->validate('foo')); 
    6058    } 
     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 
    6169 
    6270    /**