logo       

cvs: pear(ZEND_ENGINE_2) /PHPUnit/GUI README gui.php /PHPUnit/PHPUnit/GUI : msg#00581

php.cvs.pear

Subject: cvs: pear(ZEND_ENGINE_2) /PHPUnit/GUI README gui.php /PHPUnit/PHPUnit/GUI README gui.php

sebastian Wed Sep 25 15:12:33 2002 EDT

Added files: (Branch: ZEND_ENGINE_2)
/pear/PHPUnit/PHPUnit/GUI README gui.php

Removed files:
/pear/PHPUnit/GUI README gui.php
Log:
Move GUI.



Index: pear/PHPUnit/PHPUnit/GUI/gui.php
+++ pear/PHPUnit/PHPUnit/GUI/gui.php
<?php
//
// +----------------------------------------------------------------------+
// | PHP Version 4 |
// +----------------------------------------------------------------------+
// | Copyright (c) 1997-2002 The PHP Group |
// +----------------------------------------------------------------------+
// | This source file is subject to version 2.02 of the PHP license, |
// | that is bundled with this package in the file LICENSE, and is |
// | available at through the world-wide-web at |
// | http://www.php.net/license/2_02.txt. |
// | If you did not receive a copy of the PHP license and are unable to |
// | obtain it through the world-wide-web, please send a note to |
// | license@xxxxxxx so we can mail you a copy immediately. |
// +----------------------------------------------------------------------+
// | Author: Alexander Merz <alexmerz@xxxxxxx> |
// +----------------------------------------------------------------------+
//
// $Id: gui.php,v 1.1 2002/09/25 19:10:34 sebastian Exp $
//


// Set the name of your testsuite class
$testName = "";
// Set the path of your testsuite file
$testFile = "";

require_once "PHPUnit.php";
require_once $testFile;

// run test
$suite = new PHPUnit_TestSuite($testName);
$result = PHPUnit::run($suite);

// do some calculations
$per = 100/$result->runCount();
$notOkWidth = ($per*$result->errorCount())+($per*$result->failureCount());
$okWidth = 100 - $notOkWidth ;

?>

<html>
<head>
<title>PHPUnit - GUI</title>
</head>
<body>
<h1>PHPUnit GUI</h1>
<h2><?php echo $testName; ?></h2>
<table>
<tr><td>Runs:</td><td> <?php echo $result->runCount(); ?></td></tr>
<tr><td>Errors:</td><td> <?php echo $result->errorCount(); ?></td></tr>

<tr><td>Failures: </td><td><?php echo $result->failureCount();
?></td></tr>
</table>
<table width="50%">
<tr>
<td width="20%" align="left">0%</td>
<td width="20%" align="center">25%</td>
<td width="20%" align="center">50%</td>
<td width="20%" align="center">75%</td>
<td width="20%" align="right">100%</td>

</tr>
</table>
<table width="50%" height="30px" cellspan="0" cellpadding="0">
<tr>
<td width="<?php echo $okWidth; ?>%" bgcolor="green"></td>
<td width="<?php echo $notOkWidth; ?>%" bgcolor="red"></td>

</tr>
</table>
<h3>Failures</h3>
<form>
<textarea wrap="physical" cols="80" rows="10">
<?php
// print the failures
$fails = $result->failures();
foreach($fails as $failure) {
echo $failure->toString();
echo "-------------------------------\n";
}
?>
</textarea>
</form>
<h3>Errors</h3>
<form>
<textarea wrap="physical" cols="80" rows="10">
<?php
// print the errors
$errs = $result->errors();
foreach($errs as $error) {
echo $errors->toString();
echo "-------------------------------\n";
}
?>
</textarea>
</form>
</body>
</html>


--
PEAR CVS Mailing List (http://pear.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise