Changeset 318

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

added net.stubbles.ipo.request.stubRequest::getMethod()

Files:

Legend:

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

    r151 r318  
    101101     
    102102    /** 
     103     * returns the request method 
     104     * 
     105     * @return  string 
     106     */ 
     107    public function getMethod(); 
     108     
     109    /** 
    103110     * checks whether a request value is valid or nor 
    104111     * 
  • trunk/src/main/php/net/stubbles/ipo/request/stubRequestPrefixDecorator.php

    r299 r318  
    175175     
    176176    /** 
     177     * returns the request method 
     178     * 
     179     * @return  string 
     180     */ 
     181    public function getMethod() 
     182    { 
     183        return $this->request->getMethod(); 
     184    } 
     185     
     186    /** 
    177187     * checks whether a request value is valid or nor 
    178188     * 
  • trunk/src/main/php/net/stubbles/ipo/request/stubWebRequest.php

    r298 r318  
    3333        $this->unsecureCookies = $_COOKIE; 
    3434    } 
     35     
     36    /** 
     37     * returns the request method 
     38     * 
     39     * @return  string 
     40     */ 
     41    public function getMethod() 
     42    { 
     43        return $_SERVER['REQUEST_METHOD']; 
     44    } 
    3545} 
    3646?> 
  • trunk/src/test/php/net/stubbles/ipo/request/stubAbstractRequestTestCase.php

    r298 r318  
    1919        $this->unsecureCookies = array('baz' => 'foo'); 
    2020    } 
     21 
     22    public function getMethod() 
     23    { 
     24        return 'test'; 
     25    } 
    2126     
    2227    public function setValueError($valueName, stubRequestValueError $error) 
  • trunk/src/test/php/net/stubbles/ipo/request/stubRequestPrefixDecoratorTestCase.php

    r299 r318  
    177177        $this->assertEqual($this->request->getValueErrors(stubRequest::SOURCE_COOKIE), array('test_foo' => array(), 'bar' => array())); 
    178178    } 
     179     
     180    /** 
     181     * assure that the cancel methods are called 
     182     */ 
     183    public function testCancel() 
     184    { 
     185        $this->mockRequest->expectOnce('cancel'); 
     186        $this->mockRequest->expectOnce('isCancelled'); 
     187        $this->mockRequest->setReturnValue('isCancelled', true); 
     188        $this->request->cancel(); 
     189        $this->assertTrue($this->request->isCancelled()); 
     190    } 
     191     
     192    /** 
     193     * assure that getMethod() is called 
     194     */ 
     195    public function testGetMethod() 
     196    { 
     197        $this->mockRequest->expectOnce('getMethod'); 
     198        $this->mockRequest->setReturnValue('getMethod', 'test'); 
     199        $this->assertEqual($this->request->getMethod(), 'test'); 
     200    } 
    179201} 
    180202?>