Looking at your effort gave me the incentive to go off and write my own version. Although the source is completely different I based the HTML style on yours and gave you credit in the report footer and in the README files.
Instead of using the JSON listener and then deciphering its output, my version inserts a proper HTML printer object which derived from the base PHPUnit framework printer interface.
It also uses the normal ‘runner’ object used by the command line version so that most command line options are available via URL parameters.
Once again to use it you just drop the example ‘index.php’ file into your tests directory and point the browser at it. If the PHPUnit and PHPUnit_Html projects are not in the PHP include path then you need to either add them there or edit the ‘index.php’ file to add the paths to the projects.
It also has the option to view the source code of each test in the report.
You can see a demo of the output generated at https://www.nickturner.co.uk/libs/PHPUnit_Html/demo/.
For more details read the README file at https://github.com/nickturner/PHPUnit_Html/
Thanks for the inspiration and hope you don’t mind me reusing some of your ideas.
If someone could use it: https://github.com/JKrems/yii-report]]>
Thanks for releasing your code! I found your project after searching for a front-end for PHPUnit on StackOverflow. I ended up forking it and making a bunch of modifications – the most notable of which, I think, is the ability to log the unit test results (both visually and with JSON). Check it out here:
Requiring, or even supporting, full paths is very dangerous. Seriously.
You should only always support relativistic paths to the base of the project. So add this to Main/index.php:
19 $path = str_replace(‘../’, ”, $_GET['path']); // Protect against unauthorized file access.
20 $_GET['path'] = realpath(dirname(__FILE__) . ‘/../../’ . $path);
Also, in the same file, I have this, that enables TestDox output and Code Coverage output, as well:
42 <iframe src="/” width=”100%” height=”100%”>