Changeset 157

Show
Ignore:
Timestamp:
01/25/07 22:32:38 (1 year ago)
Author:
mikey
Message:

correct doc block
add a workaround if test is run in cli mode

Files:

Legend:

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

    r154 r157  
    11<?php 
    22/** 
    3  * interface for sessions 
     3 * Session class using default PHP sessions. 
    44 * 
    55 * @author      Frank Kleine <mikey@stubbles.net> 
     
    99stubClassLoader::load('net.stubbles.ipo.session.stubBaseSession'); 
    1010/** 
    11  * interface for sessions 
     11 * Session class using default PHP sessions. 
     12 *  
     13 * This session class offers session handling based on the default PHP session  
     14 * functions. 
    1215 * 
    1316 * @package     stubbles 
    1417 * @subpackage  ipo_session 
    15  * @todo        create test 
     18 * @uses        http://php.net/session 
    1619 */ 
    1720class stubPHPSession extends stubBaseSession 
  • trunk/src/test/php/net/stubbles/ipo/session/stubPHPSessionTestCase.php

    r155 r157  
    2626     */ 
    2727    protected $session; 
     28    /** 
     29     * switch whether user agent has been that by test 
     30     * 
     31     * @var  bool 
     32     */ 
     33    protected $userAgentSet = false; 
    2834     
    2935    /** 
     
    3743            $this->session->destroy(); 
    3844        } 
     45         
     46        if (isset($_SERVER['HTTP_USER_AGENT']) == false) { 
     47            $_SERVER['HTTP_USER_AGENT'] = 'dummy for preventing E_NOTICE in cli mode.'; 
     48            $this->userAgentSet         = true; 
     49        } 
     50         
    3951        $this->session = stubBaseSession::getInstance('TestPHP', 'test'); 
    4052    } 
     
    4658    { 
    4759        $this->session->destroy(); 
     60        if (true == $this->userAgentSet) { 
     61            unset($_SERVER['HTTP_USER_AGENT']); 
     62            $this->userAgentSet = false; 
     63        } 
    4864    } 
    4965