Contact Us

CakePHP Code Coverage for Group Tests

Posted on 2/6/08 by Tim Koschützki

Hey folks (what the heck, do we always start our posts with that phrase?),

Yeah so the new code coverage in the cake core is also capable of tracking the amount of code lines covered in each test case file when running a group test. Just form your groups, hop into the testsuite, run the group and then run the code coverage analyzation.

Here is an example output for one of the core groups:

I did not put this in the first post about Code Coverage Analysis in CakePHP, because this was an enhancement committed a few days after the initial code coverage implementation.


You can skip to the end and add a comment.

deizel  said on Oct 12, 2008:

this is great, but even until now, i still find it a pain to install xdebug properly under certain configurations.

windows 2000/xp just seems to crash apache, and, under ubuntu, firefox just seems to want to save the code coverage page as a blank file.

don't get me wrong, it's an amazing feature! it's just that it is not that easy to get working correctly that quickly in every case.. given the resources available.

Przemyslaw Wroblewski  said on Jan 20, 2009:

@deizel: I've got same problem, but found solution on:

Changing line 115 of /cake/tests/lib/code_coverage_manager.php to

fixed the problem.

Sean  said on Nov 02, 2009:

@Przemyslaw: I just tried this on Ubuntu 9.10, thanks a lot!

This post is too old. We do not allow comments here anymore in order to fight spam. If you have real feedback or questions for the post, please contact us.