File: Debug.php

package info (click to toggle)
php-mdb2 2.5.0b5-2.1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 956 kB
  • sloc: php: 9,735; xml: 1,741; pascal: 126; makefile: 5
file content (69 lines) | stat: -rw-r--r-- 1,690 bytes parent folder | download | duplicates (3)
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
<?php

/**
 * A place to point debuggers for running specific tests
 *
 * To change the test called, edit addTestSuite()'s parameter.
 *
 * You may need to add your <DBMS>_TEST_* environment variables here.
 * See the example in the code, below.
 *
 * @package MDB2
 * @category Database
 * @author Daniel Convissor <danielc@php.net>
 */


/*
$_ENV['MYSQL_TEST_USER']='test';
$_ENV['MYSQL_TEST_PASSWD']='test';
$_ENV['MYSQL_TEST_DB']='test';
$_ENV['MYSQL_TEST_SOCKET']='/var/run/mysqld/mysqld.sock';
*/


// Setting this here because this isn't the general test suite.
error_reporting(E_ALL & ~E_STRICT & ~E_DEPRECATED);

// Keep tests from running twice when calling this file directly via PHPUnit.
$call_main = false;
if (strpos($_SERVER['argv'][0], 'phpunit') === false) {
    // Called via php, not PHPUnit.  Pass the request to PHPUnit.
    if (!defined('PHPUnit_MAIN_METHOD')) {
        /** An indicator of which test was called. */
        define('PHPUnit_MAIN_METHOD', 'Debug::main');
        $call_main = true;
    }
}

/**
 * Establish the test suite's environment.
 */
require_once __DIR__ . '/autoload.inc';

/**
 * A place to point debuggers for running specific tests
 *
 * To change the test called, edit addTestSuite()'s parameter.
 *
 * @package MDB2
 * @category Database
 * @author Daniel Convissor <danielc@php.net>
 */
class Debug {
    public static function main() {
        PHPUnit_TextUI_TestRunner::run(self::suite());
    }

    public static function suite() {
        $suite = new PHPUnit_Framework_TestSuite('MDB2 Test Debugging');

        $suite->addTestSuite('Standard_DatatypeTest');

        return $suite;
    }
}

if ($call_main) {
    Debug::main();
}