PEAR is discontinued

This is a static archive preserving historical releases and metadata. No new packages or updates will be published. For updates to existing packages, or to publish new packages, please use Composer and Packagist.

Home » Testing » PHPUnit2 » Bug #4381

Add quiet mode that prints nothing if tests successful

Details

Request #4381Add quiet mode that prints nothing if tests successful
Submitted2005-05-18 16:30 UTC
Frommatt at engsoc dot org
StatusWont fix
PackagePHPUnit2
PHP Version5.0.4
OSAll
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()) {
// ...
}
?>