Can we save the result of the PHPUnit test

Is it possible to save the result generated from the PHPUnit test as a text file or as an html file so that we can view it later and send it to an interested person by e-mail? Just my requirement is to save the out put that we get in the IDE (Netbean or Eclipse) or on the command line to a file on the local system (on the system where I run the test). after a long search, I did not find the solution I needed. if anyone has a solution please help me.

+4
source share
2 answers

If you use the command line on unix, could you just use > to redirect the output to a text file?

 phpunit ArrayTest > MyArrayTestOutput.txt 

Most IDEs will also allow you to copy / paste the output of your buffer / terminal to where your heart desires.

+10
source

PHPUnit offers three command line options for saving results to a file:

phpunit --log-junit results.xml test.php - saves test.php results as an XML file results.xml

phpunit --log-tap - will be saved as TAP

phpunit --log-json - will be saved as JSON

+16
source

All Articles