Show
Ignore:
Timestamp:
11/28/2006 05:34:00 PM (2 years ago)
Author:
wei
Message:

Make simpletest E_STRICT compatible

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • branches/3.0/tests/test_tools/simpletest/authentication.php

    r1397 r1526  
    1010     */ 
    1111    require_once(dirname(__FILE__) . '/http.php'); 
    12      
     12 
    1313    /** 
    1414     *    Represents a single security realm's identity. 
     
    2121        protected $_username; 
    2222        protected $_password; 
    23          
     23 
    2424        /** 
    2525         *    Starts with the initial entry directory. 
     
    3636            $this->_password = false; 
    3737        } 
    38          
     38 
    3939        /** 
    4040         *    Adds another location to the realm. 
     
    4545            $this->_root = $this->_getCommonPath($this->_root, $url->getPath()); 
    4646        } 
    47          
     47 
    4848        /** 
    4949         *    Finds the common starting path. 
     
    6363            return implode('/', $first) . '/'; 
    6464        } 
    65          
     65 
    6666        /** 
    6767         *    Sets the identity to try within this realm. 
     
    7474            $this->_password = $password; 
    7575        } 
    76          
     76 
    7777        /** 
    7878         *    Accessor for current identity. 
     
    8383            return $this->_username; 
    8484        } 
    85          
     85 
    8686        /** 
    8787         *    Accessor for current identity. 
     
    9292            return $this->_password; 
    9393        } 
    94          
     94 
    9595        /** 
    9696         *    Test to see if the URL is within the directory 
     
    109109            return false; 
    110110        } 
    111          
     111 
    112112        /** 
    113113         *    Tests to see if one string is a substring of 
     
    123123        } 
    124124    } 
    125      
     125 
    126126    /** 
    127127     *    Manages security realms. 
     
    131131    class SimpleAuthenticator { 
    132132        protected $_realms; 
    133          
     133 
    134134        /** 
    135135         *    Clears the realms. 
     
    139139            $this->restartSession(); 
    140140        } 
    141          
     141 
    142142        /** 
    143143         *    Starts with no realms set up. 
     
    147147            $this->_realms = array(); 
    148148        } 
    149          
     149 
    150150        /** 
    151151         *    Adds a new realm centered the current URL. 
     
    167167            $this->_realms[$url->getHost()][$realm] = new SimpleRealm($type, $url); 
    168168        } 
    169          
     169 
    170170        /** 
    171171         *    Sets the current identity to be presented 
     
    182182            } 
    183183        } 
    184          
     184 
    185185        /** 
    186186         *    Finds the name of the realm by comparing URLs. 
     
    200200            return false; 
    201201        } 
    202          
     202 
    203203        /** 
    204204         *    Presents the appropriate headers for this location. 
     
    219219            $this->addBasicHeaders($request, $username, $password); 
    220220        } 
    221          
     221 
    222222        /** 
    223223         *    Presents the appropriate headers for this 
     
    229229         *    @static 
    230230         */ 
    231         function addBasicHeaders($request, $username, $password) { 
     231        static function addBasicHeaders($request, $username, $password) { 
    232232            if ($username && $password) { 
    233233                $request->addHeaderLine(