You Are Here: Home » Documentation » Reports

Enhance PHP Unit Testing And Mocking Framework improve the quality


Enhance PHP has Command Line, HTML and XML reports. 

To get your preferred report, you just pass in the type of report you want:


You can use the built-in constants rather than magic strings:


The available options are:

Here are examples of the reports...

Command Line

If you run Enhance PHP from the command line, you will automatically get the command line version of the report - you can also get the command line output in your browser using:


Simply run the command from the folder containing your test file, calling the php program and passing in the file name of your test file.

These examples are from a Windows machine, but it works just as well on your Linux machine too.

C:\enhance\tests> C:\php\php5.3.0\php.exe MyTest.php

Enhance PHP Command Line


\Enhance\Core::runTests(); // html is the default option

You can view a live HTML report here.


TAP (Test Anything Protocol) is a specific format that outputs test results in machine readable format.

ok 1 assertAreIdenticalWithIdenticalIntegers - Passed
ok 2 assertAreIdenticalWithDifferentIntegers - Passed
ok 3 assertAreIdenticalWithIdenticalStrings - Passed


You can opt for XML reports if you prefer, simply set XML as the output type when you call runTests:


Here is an example of the output.

<?xml version="1.0" encoding="UTF-8" ?>
		<result>Test Failed</result>
			<fail>AddTwoNumbersWith5and5Expect9Test - Failed</fail>
			<pass>AddTwoNumbersWith3and2Expect5Test - Passed</pass>
			<pass>AddTwoNumbersWith4and2Expect6Test - Passed</pass>