Changeset 1499

Show
Ignore:
Timestamp:
04/05/08 00:56:00 (1 month ago)
Author:
mikey
Message:

extended test coverage for net::stubbles::util::Binford, removed useless methods

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/src/main/php/net/stubbles/util/Binford.php

    r1230 r1499  
    5454        return array('allowedValues' => array(self::POWER, 'Binford', 'Binford ' . self::POWER)); 
    5555    } 
    56      
    57     /** 
    58      * switch whether a value is required or not 
    59      * 
    60      * @param  bool  $required 
    61      */ 
    62     public function setRequired($required) 
    63     { 
    64         // deny 
    65     } 
    66      
     56 
    6757    /** 
    6858     * execute the filter 
     
    8171    } 
    8272 
    83     /** 
    84      * set a default value in case the value to filter is not set 
    85      * 
    86      * @param  mixed  $defaultValue 
    87      */ 
    88     public function setDefaultValue($defaultValue) 
    89     { 
    90         // not supported by this filter 
    91     } 
    92  
    93     /** 
    94      * returns true if the filter has a default value in case the value to filter is not set 
    95      * 
    96      * @return  bool 
    97      */ 
    98     public function hasDefaultValue() 
    99     { 
    100         return true; 
    101     } 
    10273 
    10374    /** 
  • trunk/src/test/php/net/stubbles/util/BinfordTestCase.php

    r1288 r1499  
    6868 
    6969    /** 
     70     * post process adds a binford header 
     71     * 
     72     * @test 
     73     */ 
     74    public function postProcess() 
     75    { 
     76        $mockResponse = $this->getMock('stubResponse'); 
     77        $mockResponse->expects($this->once()) 
     78                     ->method('addHeader') 
     79                     ->with($this->equalTo('X-Binford'), $this->equalTo(Binford::POWER)); 
     80        $this->binford->postProcess($this->getMock('stubRequest'), $this->getMock('stubSession'), $mockResponse); 
     81    } 
     82 
     83    /** 
    7084     * assert that the binford hash code always equals the power of binford 
    7185     * 
     
    90104        $this->assertFalse($this->binford->equals('Bob Vila')); 
    91105    } 
     106 
     107    /** 
     108     * string representation 
     109     * 
     110     * @test 
     111     */ 
     112    public function stringOf() 
     113    { 
     114        $this->assertEquals("net::stubbles::util::Binford {\n    POWER(integer): 6100\n}\n", (string) $this->binford); 
     115    } 
    92116} 
    93117?>