예제 #1
0
<?php

// $Id: all_tests.php,v 1.2 2004/08/16 08:55:24 hfuecks Exp $
require_once 'simple_include.php';
require_once 'calendar_include.php';
define("TEST_RUNNING", true);
require_once './calendar_tests.php';
require_once './calendar_tabular_tests.php';
require_once './validator_tests.php';
require_once './calendar_engine_tests.php';
require_once './calendar_engine_tests.php';
require_once './table_helper_tests.php';
require_once './decorator_tests.php';
require_once './util_tests.php';
class AllTests extends GroupTest
{
    function AllTests()
    {
        $this->GroupTest('All PEAR::Calendar Tests');
        $this->AddTestCase(new CalendarTests());
        $this->AddTestCase(new CalendarTabularTests());
        $this->AddTestCase(new ValidatorTests());
        $this->AddTestCase(new CalendarEngineTests());
        $this->AddTestCase(new TableHelperTests());
        $this->AddTestCase(new DecoratorTests());
        $this->AddTestCase(new UtilTests());
    }
}
$test = new AllTests();
$test->run(new HtmlReporter());
예제 #2
0
<?php

// $Id$
if (!defined('TEST')) {
    define('TEST', __FILE__);
}
require_once dirname(__FILE__) . '/test_groups.php';
require_once dirname(__FILE__) . '/../reporter.php';
$test = new AllTests();
if (SimpleReporter::inCli()) {
    $result = $test->run(new SelectiveReporter(new TextReporter(), @$argv[1], @$argv[2]));
    return $result ? 0 : 1;
}
$test->run(new SelectiveReporter(new HtmlReporter(), @$_GET['c'], @$_GET['t']));
    }
}
class ShowSimplePasses extends TextReporter
{
    var $lastfile = '';
    function paintPass($message)
    {
        parent::paintPass($message);
        $breadcrumb = $this->getTestList();
        array_shift($breadcrumb);
        if ($this->lastfile != $breadcrumb[0]) {
            print "{$breadcrumb['0']}\n";
            $this->lastfile = $breadcrumb[0];
        }
        array_shift($breadcrumb);
        print "\t" . implode(":", $breadcrumb) . ": OK\n";
        //print ": $message\n";
    }
}
class AllTests extends TestSuite
{
    function AllTests()
    {
        $this->TestSuite('All tests');
        $this->addFile('tests/activerecord.php');
        //        $this->addFile('tests/livetest.php');
    }
}
$test = new AllTests();
$test->run(new ShowSimplePasses());