PHPUnit & Selenium code coverage - coverage metrics stop halfway through the test

I am just starting to work with PHPUnit and Selenium, but one problem bothers me: I cannot get the correct coverage numbers.

My application accepts the user through a multi-stage process, which includes several pages, each of which is processed in PHP using the display function (for HTML output) and the processing function (for processing the results of POST operations). My basic test goes through the whole process and correctly completes a visit to each of the seven pages. I checked it visually and through the statements in the test folder itself.

This problem is that the coverage report indicates that only the first two functions are performed, and the rest are never visited (despite my visual and verification checks). I thought the problem was with the PHP notification that occurred during the first function, and this might prevent XDebug / PHPUnit from collecting statistics, but I fixed it and the problem remained.

Is there anything that can stop the collection of coverage statistics in the middle of the test? All the functions in question are located in one file and are called from a (other) central PHP script that selects which function to call based on the shift variable.

+3
source share

All Articles