Anyone know how to use the code coverage plugin for PHPUnit

Does anyone know how to use the code coverage plugin for PHPUnit inside PHPStorm 2.1.x
I am having a really hard time understanding how to use it
codecoverage.PNG

10 comments
Comment actions Permalink

Hmm, what happen when you select in this window your clover xml file (generated by phpunit)? You need generate it first using command line option --coverage-clover /tmp/coverage.xml or adding to your phpunit.xml new <log type="coverage-clover" target="/tmp/coverage.xml"/> directive to <logging> section.

0
Comment actions Permalink

Ok I will try that. Thank you, sorry for the late response was out all day. I will post back withthe results but I am sure you are correct.

0
Comment actions Permalink

OK I tried running the command you mentioned but no file is generated whe I run this command. Not sure what I am missing here.

0
Comment actions Permalink

OK that worked its just the PHPUnit command is cryptic
thank you

0
Comment actions Permalink

Thanks for support!

0
Comment actions Permalink

I'm confused. I thought PHPUnit logging was not supported.

http://devnet.jetbrains.net/thread/311958?tstart=0

0
Comment actions Permalink

Zyava wrote:

Hmm, what happen when you select in this window your clover xml file (generated by phpunit)? You need generate it first using command line option --coverage-clover /tmp/coverage.xml or adding to your phpunit.xml new <log type="coverage-clover" target="/tmp/coverage.xml"/> directive to <logging> section.

So, he used the command line, because the other is not supported yet, correct?

0
Comment actions Permalink

I did it using phing. there is not real way to run phpUnit loggin in PHPStorm as far as I know. But I did find this one plugin for PHPStorm that shows code coverage directly int he editor when I run the phing script. I don not lnow how to integrate the PHPUnit.xml file into the run configuration so that when I run my test it also performs code coverage, that i have yet to figure out but this is a good start.

If anyone knows how to integrate the PHPUnit.cml file in PHPStorm please let me knowm because right now the phing inegration is a bit fo a hack.

0
Comment actions Permalink

yes I usewd the command line to generate the clover.xml file. You can also do this via Phing but it is not ideal.

0
Comment actions Permalink

Do you have xdebug installed?

Sadly phpunit doesn't fail if you try to generate coverage without xdebug loaded.

0

Please sign in to leave a comment.