Tag Archives: phpunit

Code-Coverage with PCOV in a mono-repo

Today I finally managed to find and fix an issue that we had for some time with Code-Coverage generation with PCOV in github actions.

To give you a bit of background, imagine a project that uses 2 separate folders where one contains the business-logic and one contains the framework-related code. The framework-related part contains a lot of integration and end-to-end test that – of course – also use and therefore test the business-logic.

Every PullRequest runs the tests both from the bunsiness-logic part as well as from the framework-related part. And to give the developers feedback how well the changed code is covered with tests we collect coverage data and generate a patch-coverage report. I wrote about that some time back. So we now get a comment each in the PR that contains the untested lines in the business-logic related part and the framework-related part respectively.

That worked flawlessly for the business-logic related part as those were mostly unit-tests that do not rely upon the framework-related code.

The framework-related part though didn’t work that great. It always showed the business-logic related parts as untested even though I knew they were tested.

Continue reading Code-Coverage with PCOV in a mono-repo

Quality-Assurance with PHP – Unit-Testing

Unit-Testing

There has been much said about the advantages or disadvantages of unit-testing. So I will not recap on that.
But where to go after you have choosen to use unit-testing?

The following short tutorial will give you an ovberview of how to install the necessary software, how to come to unit-tests from your requirements and how to write your tests and your code simultaneously.
Continue reading Quality-Assurance with PHP – Unit-Testing