14 comments

Hello Bill,

Not yet, please vote for http://youtrack.jetbrains.net/issue/WI-313 or submit a different issue if you like.

Regards,
Kirill

0

Please try my plugin, it can highlight covered lines in the editor.

http://plugins.jetbrains.net/plugin/?webide&id=6167

0

First you have to set up phpunit to generate a clover xml. Then you set the path to that xml in the plugin's settings, and you're done. If you are using the phpstorm test runner, then the coverage will be displayed after you run the tests. If you execute you tests in a cli or with ssh, the coverage will be displayed when phpstorm finds that the xml file is changed. This happens when you switch task back to phpstorm.

0

Hi Zsolt!

Thanks for the great plugin - you guys are making PHP development way easier.
Let me ask you something: Is there a way to debug your plugin?

For some reason coverage is not displayed after my tests run.

Here is my setup:
coverage.gif
So, as you can see, my clover file is being generated and the plugin is pointing to it. See attached (coverage.xml)
I dont know what I'm missing so maybe if I can debug the plugin I may find the issue and my code may look more green-ish :)

Here is the code that is not being colored (you can see in the xml file that the lines are matching with the function):
coverage2.gif
Thanks again for your work buddy!
Cheers,
Luciano



Attachment(s):
coverage.xml
0

I've written a small guide in the wiki:

https://github.com/oker1/phpunit_codecoverage_display/wiki

I'm sure there's a bug somewhere, I've only tested the windows + samba share and ssh workflow. I haven't tested with phpunit running on windows.
I'll try to debug it myself, when I'll have time. I need to set up a virtual environment for it. (Mac and Linux is tested well with several colleagues, unfortunately we don't use Windows)

If you need more information, I'll be glad to help.

0

Quick Reply! You rock!
I will give it a try this week and will get in touch if I make anything useful ;)

Thanks again man!
Cheers,
Luciano

0

Hello,

On Windows clover stores filenames in the following way:

  <file name="/C:/path/to/file.php">

So DisplayHandler simply initializes FilenameDisplayMap with the wrong filenames.

For my personal use I've made a quick hack to the CloverXmlReader to convert path to the correct Windows format.

CloverXmlReader.java, Line 32:

  String coveredFilename = element.getAttribute("name").substring(1).replace("/", "\\");

But I think that the right place for doing this transformation is CanonicalDisplayMapDecorator class.

Thanks for the plugin!

0

Hi Eugene,

On Windows clover stores filenames in the following way:

  <file name="/C:/path/to/file.php">

Actually, that is a PhpStorm issue. If you run the tests using PhpStorm functionality, you will have these paths. But if you run the same tests using phpunit command itself, you will have different paths (in generated xml files). But TBH, even phpunit itself does not generate 100% proper paths .. but at least it works.

1st line generated from PhpStorm and 2nd from command line

/E:/Projects/web/_library/Core2/API/Gravatar.php
E:\Projects\web\_library\Core2/API/Gravatar.php


Corresponding ticket: http://youtrack.jetbrains.net/issue/WI-9418?projectKey=WI

0

Hi Andriy,

Thanks for pointing to this bug. But until they fix it, I'll have to use my hack :)

0

Thanks for the windows-related information guys! I won't need to setup a windows env now.

I'll try to fix it this weekend.

0

I've fixed this issue, and I've release v0.2.1 of the plugin, it should be available from the repository soon.

0

Updated and tested on Windows. Works perfectly. Thanks for the plugin!

0

Works like a charm! Thank you very much!

0

Please sign in to leave a comment.