C:\xampp2_not used\php\tests\AllTests.php


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
<?php
/**
 * Test suite for PHP_CompatInfo
 *
 * PHP version 5
 *
 * @category PHP
 * @package  PHP_CompatInfo
 * @author   Laurent Laville <pear@laurent-laville.org>
 * @license  http://www.opensource.org/licenses/bsd-license.php  BSD
 * @version  CVS: $Id: AllTests.php,v 1.4 2008/07/22 20:27:11 farell Exp $
 * @link     http://pear.php.net/package/PHP_CompatInfo
 * @since    File available since Release 1.6.0
 */

if (!defined('PHPUnit_MAIN_METHOD')) {
    
define('PHPUnit_MAIN_METHOD''PHP_CompatInfo_AllTests::main');
}

require_once 
'PHPUnit/Framework/TestSuite.php';
require_once 
'PHPUnit/TextUI/TestRunner.php';

chdir(dirname(__FILE__));

require_once 
'PEAR/Config.php';
require_once 
'PHP_CompatInfo_TestSuite_Standard.php';
require_once 
'PHP_CompatInfo_TestSuite_Bugs.php';

/**
 * Class for running all test suites for PHP_CompatInfo package.
 *
 * @category PHP
 * @package  PHP_CompatInfo
 * @author   Laurent Laville <pear@laurent-laville.org>
 * @license  http://www.opensource.org/licenses/bsd-license.php  BSD
 * @version  Release: @package_version@
 * @link     http://pear.php.net/package/PHP_CompatInfo
 * @since    File available since Release 1.6.0
 */

class PHP_CompatInfo_AllTests
{
    
/**
     * Runs the test suite.
     *
     * @return void
     */
    
public static function main()
    {
        
PHPUnit_TextUI_TestRunner::run(self::suite());
    }

    
/**
     * Adds the PHP_CompatInfo test suite.
     *
     * @return object the PHPUnit_Framework_TestSuite object
     */
    
public static function suite()
    {
        
$suite = new PHPUnit_Framework_TestSuite('PHP_CompatInfo Test Suite');
        
$suite->addTestSuite('PHP_CompatInfo_TestSuite_Standard');
        
$suite->addTestSuite('PHP_CompatInfo_TestSuite_Bugs');

        if (
PHP_CompatInfo_AllTests::packageInstalled('Console_GetArgs''1.3.3')
            && 
PHP_CompatInfo_AllTests::packageInstalled('Console_Table''1.0.5')) {
            
/* Add CLI test suite, only
               if packages below are installed on your system :
               - Console_GetArgs 1.3.3 or better
               - Console_Table   1.0.5 or better
             */
            
include_once 'PHP_CompatInfo_TestSuite_Cli.php';

            
$suite->addTestSuite('PHP_CompatInfo_TestSuite_Cli');
        }
        return 
$suite;
    }

    
/**
     * Check if a package is installed
     *
     * Simple function to check if a package is installed under user
     * or system PEAR installation. Minimal version and channel info are supported.
     *
     * @param string $name        Package name
     * @param string $version     (optional) The minimal version
     *                            that should be installed
     * @param string $channel     (optional) The package channel distribution
     * @param string $user_file   (optional) file to read PEAR user-defined
     *                            options from
     * @param string $system_file (optional) file to read PEAR system-wide
     *                            defaults from
     *
     * @static
     * @return bool
     * @since  PEAR_Info version 1.6.0 (2005-01-03)
     * @see    PEAR_Info::packageInstalled()
     */
    
public static function packageInstalled($name$version null$channel null,
        
$user_file ''$system_file '')
    {
        
$config =& PEAR_Config::singleton($user_file$system_file);
        
$reg    =& $config->getRegistry();

        if (
is_null($version)) {
            return 
$reg->packageExists($name$channel);
        } else {
            
$info = &$reg->getPackage($name$channel);
            if (
is_object($info)) {
                
$installed['version'] = $info->getVersion();
            } else {
                
$installed $info;
            }
            return 
version_compare($version$installed['version'], '<=');
        }
    }
}

if (
PHPUnit_MAIN_METHOD == 'PHP_CompatInfo_AllTests::main') {
    
PHP_CompatInfo_AllTests::main();
}
?>
x

Windows NT KPTV 6.2 build 9200 (Windows Server 2012 Datacenter Edition) i586