main() public static method

public static main ( $className )
Exemplo n.º 1
0
                        $class->setUp();
                    }
                    $class->{$methodName}();
                }
            }
            echo '[OK]', ' (', memory_get_usage(true), ') (', memory_get_usage(false), ')', PHP_EOL;
        } else {
            echo '[FAILED]', PHP_EOL;
        }
    }
}
if (PHP_OS == 'Linux') {
    if (isset($_SERVER['LOGNAME']) && $_SERVER['LOGNAME'] == 'gutierrezandresfelipe') {
        chdir('/home/gutierrezandresfelipe/cphalcon');
    }
}
if (!extension_loaded('phalcon')) {
    throw new Exception("Sorry, but phalcon extension is not loaded");
}
try {
    if (isset($_SERVER['argv'][1])) {
        echo $_SERVER['argv'][1], PHP_EOL;
        $file = $_SERVER['argv'][1];
        require $_SERVER['argv'][1];
        PHPUnit_Framework_TestCase::main('Phalcon\\Test\\Url\\UnitTest');
    }
} catch (Exception $e) {
    echo $e->getMessage(), PHP_EOL;
    echo $e->getTraceAsString(), PHP_EOL;
    //print_r($e->getTrace());
}
Exemplo n.º 2
0
        } else {
            if (preg_match('#/([a-zA-Z0-9]+)\\.php$#', $_SERVER['argv'][1], $matches)) {
                $className = $matches[1];
            } else {
                throw new Exception("class-name plz");
            }
        }
        PHPUnit_Framework_TestCase::main($className);
    } else {
        $xml = simplexml_load_file('unit-tests/phpunit.xml');
        foreach ($xml->testsuites as $suite) {
            foreach ($suite->testsuite->file as $file) {
                $fileName = (string) $file;
                if (preg_match('#/([a-zA-Z0-9]+)\\.php$#', $fileName, $matches)) {
                    require $fileName;
                    PHPUnit_Framework_TestCase::main($matches[1]);
                } else {
                    throw new Exception("{$file} plz");
                }
            }
        }
    }
} catch (Exception $e) {
    echo $e->getMessage(), PHP_EOL;
    echo $e->getTraceAsString(), PHP_EOL;
    //print_r($e->getTrace());
}
if (function_exists('xhprof_enable')) {
    $xhprof_data = xhprof_disable('/tmp');
    $XHPROF_ROOT = "/var/www/xhprof/";
    include_once $XHPROF_ROOT . "/xhprof_lib/utils/xhprof_lib.php";
Exemplo n.º 3
0
                        $class->setUp();
                    }
                    $class->{$methodName}();
                }
            }
            echo '[OK]', ' (', memory_get_usage(true), ') (', memory_get_usage(false), ')', PHP_EOL;
        } else {
            echo '[FAILED]', PHP_EOL;
        }
    }
}
if (PHP_OS == 'Linux') {
    if (isset($_SERVER['LOGNAME']) && $_SERVER['LOGNAME'] == 'gutierrezandresfelipe') {
        chdir('/home/gutierrezandresfelipe/cphalcon');
    }
}
if (!extension_loaded('phalcon')) {
    throw new Exception("Sorry, but phalcon extension is not loaded");
}
try {
    if (isset($_SERVER['argv'][1])) {
        echo $_SERVER['argv'][1], PHP_EOL;
        $file = $_SERVER['argv'][1];
        require $_SERVER['argv'][1];
        PHPUnit_Framework_TestCase::main('Phalcon\\Test\\View\\Engines\\Volt\\UnitTest');
    }
} catch (Exception $e) {
    echo $e->getMessage(), PHP_EOL;
    echo $e->getTraceAsString(), PHP_EOL;
    //print_r($e->getTrace());
}