Library/Think/Environment.class.php
/**
     * Get mock environment instance
     *
     * @param  array               $userSettings
     * @return \Think\Environment
     */
Get mock environment instance
@param  array               $userSettings
@return \Think\Environment
Get mock environment instance @param array $userSettings @return \ Think \ Environment
public static function mock($userSettings = []) {
        $defaults = [
            'REQUEST_METHOD'  => 'GET',
            'SCRIPT_NAME'     => '',
            'PATH_INFO'       => '',
            'QUERY_STRING'    => '',
            'SERVER_NAME'     => 'localhost',
            'SERVER_PORT'     => 80,
            'ACCEPT'          => 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
            'ACCEPT_LANGUAGE' => 'en-US,en;q=0.8',
            'ACCEPT_CHARSET'  => 'ISO-8859-1,utf-8;q=0.7,*;q=0.3',
            'USER_AGENT'      => 'hhailuo Framework',
            'REMOTE_ADDR'     => '127.0.0.1',
            'hhailuo.url_scheme' => 'http',
            'hhailuo.input'      => '',
            'hhailuo.errors'     => @fopen('php://stderr', 'w'),
        ];
        self::$environment = new self(array_merge($defaults, $userSettings));
        return self::$environment;
    }
public static function mock ( $ userSettings = [ ] ) { $ defaults = [ 'REQUEST_METHOD' => 'GET' , 'SCRIPT_NAME' => '' , 'PATH_INFO' => '' , 'QUERY_STRING' => '' , 'SERVER_NAME' => 'localhost' , 'SERVER_PORT' => 80 , 'ACCEPT' => 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8' , 'ACCEPT_LANGUAGE' => 'en-US,en;q=0.8' , 'ACCEPT_CHARSET' => 'ISO-8859-1,utf-8;q=0.7,*;q=0.3' , 'USER_AGENT' => 'hhailuo Framework' , 'REMOTE_ADDR' => '127.0.0.1' , 'hhailuo.url_scheme' => 'http' , 'hhailuo.input' => '' , 'hhailuo.errors' => @ fopen ( 'php://stderr' , 'w' ) , ] ; self :: $ environment = new self ( array_merge ( $ defaults , $ userSettings ) ) ; return self :: $ environment ; }
Get mock environment instance
 @param  array               $userSettings
 @return \Think\Environment
Get mock environment instance @param array $userSettings @return \ Think \ Environment