<html> <head> <title>MDB2 Tests</title> <link href="tests.css" rel="stylesheet" type="text/css"> </head> <body> <?php foreach ($dbarray as $db) { $dsn = $db['dsn']; $options = isset($db['options']) ? $db['options'] : null; $display_dsn = $dsn['phptype'] . "://" . $dsn['username'] . ":" . $dsn['password'] . "@" . $dsn['hostspec'] . "/" . $database; echo "<div class=\"test\">\n"; echo "<div class=\"title\">Testing {$display_dsn}</div>\n"; $suite = new PHPUnit_TestSuite(); foreach ($testcases as $testcase) { if (isset($testmethods[$testcase]) && is_array($testmethods[$testcase])) { $methods = array_keys($testmethods[$testcase]); foreach ($methods as $method) { $suite->addTest(new $testcase($method)); } } } $result = new PHPUnit_TestResult(); $result->addListener(new HTML_TestListener()); $suite->run($result); echo "\n</div>\n"; } ?> </body> </html>
<?php /** * Unit tests for Event_Dispatcher class * * $Id: test.php,v 1.1.1.1 2005/11/29 19:21:53 sjhannah Exp $ * * @package Event_Dispatcher * @subpackage Tests */ require_once 'System.php'; require_once 'PHPUnit.php'; require_once 'Event/Dispatcher.php'; $testcases = array('Dispatcher_testcase'); $suite = new PHPUnit_TestSuite(); foreach ($testcases as $testcase) { include_once $testcase . '.php'; $methods = preg_grep('/^test/i', get_class_methods($testcase)); foreach ($methods as $method) { $suite->addTest(new $testcase($method)); } } require_once './Console_TestListener.php'; $result = new PHPUnit_TestResult(); $result->addListener(new Console_TestListener()); $suite->run($result);
function addPassedTest(&$test) { parent::addPassedTest($test); echo "."; }