This is a skeleton class for PhpSecInfo tests You should extend this to make a "group" skeleton to categorize tests under, then make a subdir with your group name that contains test classes extending your group skeleton class.
Located in /PhpSecInfo/Test/Test.php (line 35)
| Class | Description |
|---|---|
| PhpSecInfo_Test_Cgi | This is a skeleton class for PhpSecInfo "CGI" tests |
| PhpSecInfo_Test_Core | This is a skeleton class for PhpSecInfo "Core" tests |
| PhpSecInfo_Test_Curl | This is a skeleton class for PhpSecInfo "Curl" tests |
| PhpSecInfo_Test_Session | This is a skeleton class for PhpSecInfo "Session" tests |
This value is used to group test results together.
For example, all tests related to the mysql lib should be grouped under "mysql."
This should be a unique, human-readable identifier for this test
the language code. Should be a pointer to the setting in the PhpSecInfo object
The message corresponding to the result of the test
This is a hash of messages that correspond to various test result levels.
There are five messages, each corresponding to one of the result constants (PHPSECINFO_TEST_RESULT_OK, PHPSECINFO_TEST_RESULT_NOTICE, PHPSECINFO_TEST_RESULT_WARN, PHPSECINFO_TEST_RESULT_ERROR, PHPSECINFO_TEST_RESULT_NOTRUN)
The result returned from the test
Constructor for Test skeleton class
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.
This retrieves the name of this test.
If a name has not been set, this returns a formatted version of the class name.
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.
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'));
Sets the message for a given result code and language
- $this->setMessageForResult(PHPSECINFO_TEST_RESULT_NOTRUN, 'en', 'This test cannot be run');
This is the wrapper that executes the test and sets the result code and message
The "meat" of the test. This is where the real test code goes. You should override this when extending
Sets the $this->_message variable based on the passed result and language codes
This function loads up result messages into the $this->_messages array.
Using this method rather than setting $this->_messages directly allows result messages to be inherited. This is broken out into a separate function rather than the constructor for ease of extending purposes (php4 is whack, man).
Sets the result code
Documentation generated on Tue, 24 Oct 2006 10:53:40 -0400 by phpDocumentor 1.3.0RC3