Subversion Repositories ggsysinfo

[/] [modules/] [sysinfo/] [lib/] [PhpSecInfo/] [Test/] [Test_Cgi.php] - Blame information for rev 123

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 123 gg
<?php
2
/**
3
 * Skeleton Test class file for Cgi group
4
 *
5
 * @package PhpSecInfo
6
 * @author Ed Finkler <coj@funkatron.com>
7
 */
8
 
9
/**
10
 * require the main PhpSecInfo class
11
 */
12
require_once(PHPSECINFO_BASE_DIR.'/Test/Test.php');
13
 
14
 
15
 
16
/**
17
 * This is a skeleton class for PhpSecInfo "CGI" tests
18
 * @package PhpSecInfo
19
 */
20
class PhpSecInfo_Test_Cgi extends PhpSecInfo_Test
21
{
22
 
23
        /**
24
         * This value is used to group test results together.
25
         *
26
         * For example, all tests related to the mysql lib should be grouped under "mysql."
27
         *
28
         * @var string
29
         */
30
        var $test_group = 'CGI';
31
 
32
 
33
 
34
        /**
35
         * "CGI" tests should only be run if we're running as a CGI.  The best way I could think of
36
         * to test this was to preg against the php_sapi_name() return value.
37
         *
38
         * @return boolean
39
         */
40
        function isTestable() {
41
                /*if ( preg_match('/^cgi.*$/', PHP_SAPI) ) {
42
                        return true;
43
                } else {
44
                        return false;
45
                }*/
46
                return !strncmp(PHP_SAPI, 'cgi', 3);
47
        }
48
 
49
 
50
        /**
51
         * Set the messages for CGI tests
52
         *
53
         */
54
        function _setMessages() {
55
                parent::_setMessages();
56
 
57
                $this->setMessageForResult(PHPSECINFO_TEST_RESULT_NOTRUN, 'en', "You don't seem to be using the CGI SAPI");
58
 
59
        }
60
 
61
}