Fix testsuite failure for https mode
[plcapi.git] / test / phpunit.php
1 <?php
2 /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
3
4 /**
5  * PHP Version 4
6  *
7  * LICENSE: This source file is subject to version 3.0 of the PHP license
8  * that is available through the world-wide-web at the following URI:
9  * http://www.php.net/license/3_0.txt.  If you did not receive a copy of
10  * the PHP License and are unable to obtain it through the web, please
11  * send a note to license@php.net so we can mail you a copy immediately.
12  *
13  * @category   Testing
14  * @package    PHPUnit
15  * @author     Sebastian Bergmann <sb@sebastian-bergmann.de>
16  * @copyright  2002-2005 Sebastian Bergmann <sb@sebastian-bergmann.de>
17  * @license    http://www.php.net/license/3_0.txt  PHP License 3.0
18  * @version    CVS: $Id$
19  * @link       http://pear.php.net/package/PHPUnit
20  * @since      File available since Release 1.0.0
21  */
22
23 require_once 'PHPUnit/TestCase.php';
24 require_once 'PHPUnit/TestResult.php';
25 require_once 'PHPUnit/TestSuite.php';
26
27 /**
28  * PHPUnit runs a TestSuite and returns a TestResult object.
29  *
30  * Here is an example:
31  *
32  * <code>
33  * <?php
34  * require_once 'PHPUnit.php';
35  *
36  * class MathTest extends PHPUnit_TestCase {
37  *     var $fValue1;
38  *     var $fValue2;
39  *
40  *     function MathTest($name) {
41  *       $this->PHPUnit_TestCase($name);
42  *     }
43  *
44  *     function setUp() {
45  *       $this->fValue1 = 2;
46  *       $this->fValue2 = 3;
47  *     }
48  *
49  *     function testAdd() {
50  *       $this->assertTrue($this->fValue1 + $this->fValue2 == 5);
51  *     }
52  * }
53  *
54  * $suite = new PHPUnit_TestSuite();
55  * $suite->addTest(new MathTest('testAdd'));
56  *
57  * $result = PHPUnit::run($suite);
58  * print $result->toHTML();
59  * ?>
60  * </code>
61  *
62  * Alternatively, you can pass a class name to the PHPUnit_TestSuite()
63  * constructor and let it automatically add all methods of that class
64  * that start with 'test' to the suite:
65  *
66  * <code>
67  * <?php
68  * $suite  = new PHPUnit_TestSuite('MathTest');
69  * $result = PHPUnit::run($suite);
70  * print $result->toHTML();
71  * ?>
72  * </code>
73  *
74  * @category   Testing
75  * @package    PHPUnit
76  * @author     Sebastian Bergmann <sb@sebastian-bergmann.de>
77  * @copyright  2002-2005 Sebastian Bergmann <sb@sebastian-bergmann.de>
78  * @license    http://www.php.net/license/3_0.txt  PHP License 3.0
79  * @version    Release: @package_version@
80  * @link       http://pear.php.net/package/PHPUnit
81  * @since      Class available since Release 1.0.0
82  */
83 class PHPUnit {
84     /**
85      * Runs a test(suite).
86      *
87      * @param  mixed
88      * @return PHPUnit_TestResult
89      * @access public
90      */
91     function &run(&$suite, $show_progress=false) {
92         $result = new PHPUnit_TestResult();
93         $suite->run($result, $show_progress);
94
95         return $result;
96     }
97 }
98
99 /*
100  * Local variables:
101  * tab-width: 4
102  * c-basic-offset: 4
103  * c-hanging-comment-ender-p: nil
104  * End:
105  */
106 ?>