Changeset 377

Show
Ignore:
Timestamp:
03/14/07 12:19:46 (1 year ago)
Author:
mikey
Message:

added net.stubbles.ipo.session.stubSession::getName()

Files:

Legend:

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

    r376 r377  
    2929     * @var  bool 
    3030     */ 
    31     private $isNew = false; 
     31    private $isNew       = false; 
    3232    /** 
    3333     * the current token of the session, changes on every instantiation 
     
    3535     * @var  string 
    3636     */ 
    37     private $token  = ''; 
     37    private $token       = ''; 
     38    /** 
     39     * name of the session 
     40     * 
     41     * @var  string 
     42     */ 
     43    private $sessionName = ''; 
    3844     
    3945    /** 
     
    4652    { 
    4753        $this->doConstruct($request, $sessionName); 
    48          
     54        $this->sessionName = $sessionName; 
    4955        if ($this->hasValue(stubSession::START_TIME) == false || $this->doGetValue(stubSession::FINGERPRINT) != $this->getFingerprint()) { 
    5056            if ($this->hasValue(stubSession::START_TIME) == false) { 
     
    119125        return $this->getValue(stubSession::START_TIME); 
    120126    } 
     127     
     128    /** 
     129     * returns the name of the session 
     130     * 
     131     * @return  string 
     132     */ 
     133    public function getName() 
     134    { 
     135        return $this->sessionName; 
     136    } 
    121137 
    122138    /** 
  • trunk/src/main/php/net/stubbles/ipo/session/stubSession.php

    r344 r377  
    5353     */ 
    5454    public function getID(); 
     55     
     56    /** 
     57     * returns the name of the session 
     58     * 
     59     * @return  string 
     60     */ 
     61    public function getName(); 
    5562 
    5663    /** 
  • trunk/src/test/php/net/stubbles/ipo/session/stubAbstractSessionTestCase.php

    r376 r377  
    1616    protected function doConstruct(stubRequest $request, $sessionName) 
    1717    { 
    18         if (strlen($sessionName) > 1) { 
     18        if (strlen($sessionName) > 1 && 'foo' != $sessionName) { 
    1919            $data = explode('|', $sessionName); 
    2020            if (strlen($data[0]) > 0) { 
     
    6868    public function setUp() 
    6969    { 
    70         $this->session = new stubTestSession(new MockstubRequest(), ''); 
     70        $this->session = new stubTestSession(new MockstubRequest(), 'foo'); 
    7171    } 
    7272 
     
    7676    public function testDefaultValues() 
    7777    { 
     78        $this->assertEqual($this->session->getName(), 'foo'); 
    7879        $this->assertTrue($this->session->hasValue(stubSession::START_TIME)); 
    7980        $startTime = $this->session->getStartTime();