phpunit test guideline

Pattern

use DatabaseTransactions.

Test case coverage

(CodeCoverage)=(NumberofLinesofCodeCalledByYourTests)(TotalNumberofRelevantLinesofCode)100% (Code Coverage) = \frac{(Number of Lines of Code Called By Your Tests)}{(Total Number of Relevant Lines of Code)} * 100\%

// Generate code coverage report in Clover HTML format.
phpunit --coverage-html <dir>

// Generate code coverage report in Clover XML format.
phpunit --coverage-clover <file>

Or using phpdbg, phpdbg can avoid Xdebug.

Ref