PhpSecInfo_Test Class Reference

Inheritance diagram for PhpSecInfo_Test:
PhpSecInfo_Test_Cgi PhpSecInfo_Test_Core PhpSecInfo_Test_Curl PhpSecInfo_Test_Session PhpSecInfo_Test_Cgi_Force_Redirect PhpSecInfo_Test_Core_Allow_Url_Fopen PhpSecInfo_Test_Core_Display_Errors PhpSecInfo_Test_Core_Expose_Php PhpSecInfo_Test_Core_File_Uploads PhpSecInfo_Test_Core_Gid PhpSecInfo_Test_Core_Magic_Quotes_GPC PhpSecInfo_Test_Core_Memory_Limit PhpSecInfo_Test_Core_Open_Basedir PhpSecInfo_Test_Core_Post_Max_Size PhpSecInfo_Test_Core_Register_Globals PhpSecInfo_Test_Core_Uid PhpSecInfo_Test_Core_Upload_Max_Filesize PhpSecInfo_Test_Core_Upload_Tmp_Dir PhpSecInfo_Test_Curl_File_Support PhpSecInfo_Test_Session_Use_Trans_Sid

Public Member Functions

 PhpSecInfo_Test ()
 isTestable ()
 _execTest ()
 _setMessages ()
 test ()
 getResult ()
 getMessage ()
 setMessageForResult ($result_code, $language_code, $message)
 _setResult ($result_code)
 _setMessage ($result_code, $language_code)
 getTestName ()
 setTestName ($test_name)
 getTestGroup ()
 returnBytes ($val)
 getBooleanIniValue ($ini_key)

Data Fields

 $test_group = 'misc'
 $test_name = 'misc_test'
 $_result = PHPSECINFO_TEST_RESULT_NOTRUN
 $_message
 $_language = PHPSECINFO_LANG_DEFAULT
 $_messages = array()

Detailed Description

Definition at line 35 of file Test.php.


Member Function Documentation

_execTest (  ) 
_setMessage ( result_code,
language_code 
)

Sets the $this->_message variable based on the passed result and language codes

Parameters:
integer $result_code
string $language_code

Definition at line 247 of file Test.php.

_setMessages (  ) 
_setResult ( result_code  ) 

Sets the result code

Parameters:
integer $result_code

Definition at line 236 of file Test.php.

getBooleanIniValue ( ini_key  ) 

This method converts the several possible return values from allegedly "boolean" ini settings to proper booleans

Properly converted input values are: 'off', 'on', 'false', 'true', '0', '1' (the last two might not be neccessary, but I'd rather be safe)

If the ini_value doesn't match any of those, the value is returned as-is.

Parameters:
string $ini_key the ini_key you need the value of
Returns:
boolean|mixed

Definition at line 344 of file Test.php.

getMessage (  ) 

Retrieves the message for the current result

Returns:
string

Definition at line 194 of file Test.php.

getResult (  ) 

Retrieves the result

Returns:
integer

Definition at line 182 of file Test.php.

getTestGroup (  ) 

Returns the test group this test belongs to

Returns:
string

Definition at line 296 of file Test.php.

getTestName (  ) 

This retrieves the name of this test.

If a name has not been set, this returns a formatted version of the class name.

Returns:
string

Definition at line 267 of file Test.php.

isTestable (  ) 

Determines whether or not it's appropriate to run this test (for example, if this test is for a particular library, it shouldn't be run if the lib isn't loaded).

This is a terrible name, but I couldn't think of a better one atm.

Returns:
boolean

Reimplemented in PhpSecInfo_Test_Cgi, PhpSecInfo_Test_Core, PhpSecInfo_Test_Curl, and PhpSecInfo_Test_Session.

Definition at line 130 of file Test.php.

PhpSecInfo_Test (  ) 

Constructor for Test skeleton class

Returns:
PhpSecInfo_Test

Definition at line 116 of file Test.php.

returnBytes ( val  ) 

This function takes the shorthand notation used in memory limit settings for PHP and returns the byte value. Totally stolen from http://us3.php.net/manual/en/function.ini-get.php

echo 'post_max_size in bytes = ' . $this->return_bytes(ini_get('post_max_size'));

string $val integer

Definition at line 314 of file Test.php.

setMessageForResult ( result_code,
language_code,
message 
)

Sets the message for a given result code and language

$this->setMessageForResult(PHPSECINFO_TEST_RESULT_NOTRUN, 'en', 'This test cannot be run');

Parameters:
integer $result_code
string $language_code
string $message

Definition at line 215 of file Test.php.

setTestName ( test_name  ) 

sets the test name

Parameters:
string $test_name

Definition at line 286 of file Test.php.

test (  ) 

This is the wrapper that executes the test and sets the result code and message

Definition at line 169 of file Test.php.


Field Documentation

Definition at line 77 of file Test.php.

$_message

Definition at line 69 of file Test.php.

$_messages = array()

Reimplemented in PhpSecInfo_Test_Core_Open_Basedir, and PhpSecInfo_Test_Core_Upload_Tmp_Dir.

Definition at line 92 of file Test.php.

Definition at line 61 of file Test.php.

$test_group = 'misc'
$test_name = 'misc_test'

The documentation for this class was generated from the following file:
Generated on Tue Jun 8 12:28:39 2010 for Claroline API by  doxygen 1.6.3