Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PHPUnit: when run in command line, display code coverage?

Tags:

I'm running tests PHPUnit from command line, but can't work out how to make it show the code coverage results in the terminal.

There are various command line options here in their documentation but they all involve outputting the results to a file in one of various formats.

Am I missing an obvious solution? Or would I need to write a batch file that executes:

  1. executes the PHPUnit command and flags that output code coverage to a file
  2. outputs the contents of the file to stdio so it appears in the terminal
like image 208
CL22 Avatar asked Oct 21 '15 13:10

CL22


1 Answers

File is not mandatory for --coverage-text option, you can run just

./phpunit.phar --coverage-text

and get results in the terminal.

like image 97
Nikita U. Avatar answered Sep 21 '22 22:09

Nikita U.