Changeset 1322

Show
Ignore:
Timestamp:
02/02/08 14:25:06 (7 months ago)
Author:
mikey
Message:

changed net::stubbles::ipo::session::stubPHPSession::getFingerprint() to make use of net::stubbles::php::string::stubMd5Encoder instead of the soon to be removed net::stubbles::ipo::request::filters::stubMD5Filter

Files:

Legend:

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

    r1242 r1322  
    88 */ 
    99stubClassLoader::load('net::stubbles::ipo::session::stubAbstractSession', 
    10                       'net::stubbles::ipo::request::filters::stubMD5Filter', 
    11                       'net::stubbles::util::stubRegistry' 
     10                      'net::stubbles::php::string::stubMd5Encoder', 
     11                      'net::stubbles::util::stubRegistry', 
     12                      'net::stubbles::util::validators::stubPassThruValidator' 
    1213); 
    1314/** 
     
    5051    protected function getFingerprint() 
    5152    { 
    52         return $this->request->getFilteredValue(new stubMD5Filter('', stubRegistry::getConfig(stubSession::SALT_REGISTRY_KEY, '')), 'HTTP_USER_AGENT', stubRequest::SOURCE_HEADER); 
     53        $encoder = new stubMd5Encoder('', stubRegistry::getConfig(stubSession::SALT_REGISTRY_KEY, '')); 
     54        return $encoder->encode($this->request->getValidatedValue(new stubPassThruValidator(), 'HTTP_USER_AGENT', stubRequest::SOURCE_HEADER)); 
    5355    } 
    5456 
  • trunk/src/test/php/net/stubbles/ipo/session/stubPHPSessionTestCase.php

    r1272 r1322  
    2727     * @var  PHPUnit_Framework_MockObject_MockObject 
    2828     */ 
    29     protected $mockStubRequest; 
     29    protected $mockRequest; 
    3030     
    3131    /** 
     
    3434    public function setUp() 
    3535    { 
    36         $this->mockStubRequest = $this->getMock('stubRequest'); 
    37         $this->mockStubRequest->expects($this->any())->method('getFilteredValue')->will($this->returnValue('foobarbaz')); 
     36        $this->mockRequest = $this->getMock('stubRequest'); 
     37        $this->mockRequest->expects($this->atLeastOnce())->method('getValidatedValue')->will($this->returnValue('foobarbaz')); 
    3838        $_SESSION      = array(); 
    39         $this->session = new stubPHPSession($this->mockStubRequest, 'test'); 
     39        $this->session = new stubPHPSession($this->mockRequest, 'test'); 
    4040    } 
    4141