Home » Testing » PHPUnit2 » Bug #4381
Add quiet mode that prints nothing if tests successful
Details
| Request #4381 | Add quiet mode that prints nothing if tests successful |
|---|---|
| Submitted | 2005-05-18 16:30 UTC |
| From | matt at engsoc dot org |
| Status | Wont fix |
| Package | PHPUnit2 |
| PHP Version | 5.0.4 |
| OS | All |
| Roadmaps | (Not assigned) |
Comments
[2005-05-18 16:30 UTC] matt at engsoc dot org
Description:
------------
I'd like to be able to run all the tests for my application from a shell script and only see output if there are failed tests or errors.
A command-line switch to turn off output if all tests are successful would be very useful.
[2005-10-15 08:50 UTC] sebastian at php dot net
I will not implement this for the TextUI test runner.
You can implement it yourself, though:
<?php
require_once 'PHPUnit2/Framework/TestSuite.php';
require_once 'SampleTest.php';
// Create a test suite that contains the tests
// from the SampleTest class.
$suite = new PHPUnit2_Framework_TestSuite('SampleTest');
// Run the test suite.
$result = $suite->run($result);
// Do something if the test suite yielded a failure or error.
if (!$result->wasSuccessful()) {
// ...
}
?>