Changeset 736

Show
Ignore:
Timestamp:
06/14/07 15:38:29 (1 year ago)
Author:
mikey
Message:

implemented new filter method

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/src/main/php/net/stubbles/ipo/request/broker/annotations/stubStringFilterAnnotation.php

    r731 r736  
    3939     * @var  string 
    4040     */ 
    41     protected $regex     = ''; 
     41    protected $regex     = null; 
     42 
     43    /** 
     44     * checks if the regex property is set 
     45     * 
     46     * @throws  ReflectionException 
     47     */ 
     48    public function finish() 
     49    { 
     50        if (null === $this->regex) { 
     51            throw new ReflectionException('Can not use ' . $this->getClassName() . ' without setting the regular expression via regex property.'); 
     52        } 
     53    } 
    4254 
    4355    /** 
  • trunk/src/test/php/net/stubbles/ipo/request/broker/annotations/stubStringFilterAnnotationTestCase.php

    r731 r736  
    6161        $this->assertEqual($stringFilter->getRegexValidator()->getValue(), 'foo'); 
    6262    } 
     63 
     64    /** 
     65     * test that finish() works as expected 
     66     */ 
     67    public function testFinish() 
     68    { 
     69        $this->stringFilterAnnotation->setRegex(); 
     70        $this->expectException('ReflectionException'); 
     71        $this->stringFilterAnnotation->finish(); 
     72    } 
    6373} 
    6474?>