Пример #1
0
 * etc.
 *
 * @package    OpenX
 * @subpackage TestSuite
 * @author     Andrew Hill <*****@*****.**>
 *
 * @todo Only show HTML when run from Web.
 */
require_once 'init.php';
// Mask strict errors. Simpletest is too old for that
error_reporting(error_reporting() & ~E_STRICT);
// Required files
require_once MAX_PATH . '/tests/testClasses/TestRunner.php';
require_once MAX_PATH . '/tests/testClasses/ErrorCatcher.php';
$runner = new TestRunner();
$runner->findDefaults();
$oErrorCatcher = new SimpletestErrorCatcher($runner);
/* TODO: Extract this to the paintHeader() method of a reporter */
if ($runner->output_format_name == 'html') {
    echo "<style type=\"text/css\">\n";
    echo file_get_contents(MAX_PATH . '/tests/testClasses/tests.css');
    echo "</style>\n";
}
/* TODO: Consider a non-Web environment */
if (defined('TEST_ENVIRONMENT_NO_CONFIG')) {
    echo "<h1>Cannot Run Tests</h1>\n";
    echo "<p>You have not copied the the test.conf.php file in the\n";
    echo "/etc directory into the /var directory, and edited the file,\n";
    echo "so that it contains your database server details.</p>\n";
    exit;
}