Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Method name should not appear in the method signature attribute of Cobertura XML #846

Closed
derekrprice opened this issue Jan 28, 2021 · 4 comments

Comments

@derekrprice
Copy link

Q A
php-code-coverage version 9.2.5
PHP version 7.4
Driver Xdebug
Xdebug version (if used) 2.9.8
Installation Method Composer
Usage Method PHPUnit
PHPUnit version (if used) 9.5.1

I'm not actually sure that this is a problem with the new cobertura.xml support in php-code-coverage from PR #812 or in AzureDevops, but I suspect the former. At the least, it is probably out of sync with other Cobertura generators. The name of methods appears in both the "name" and "signature" attributes in the generated XML, like so:

<method name="__construct" signature="__construct(string $identifier, League\OAuth2\Server\Repositories\RefreshTokenRepositoryInterface $refreshTokenRepository)

This causes the Azure DevOps code coverage plugin to then render every name twice:
image

@derekrprice
Copy link
Author

I reported this as an issue to Azure DevOps too, as I am unsure who is at fault: https://developercommunity.visualstudio.com/content/problem/1323739/code-coverage-task-renders-method-names-twice.html

@sebastianbergmann
Copy link
Owner

CC @smmccabe

@smmccabe
Copy link
Contributor

Officially a function signature is the whole thing, but I looked into the Cobertura java source code and it only does the arguments like string $identifier, League\OAuth2\Server\Repositories\RefreshTokenRepositoryInterface $refreshTokenRepositor so I guess that is what we should follow.

I'll make up a PR once I get a spare moment.

@sebastianbergmann
Copy link
Owner

Thank you, Shawn.

@sebastianbergmann sebastianbergmann changed the title Method Name should not Appear in the Method Signature Attribute Method name should not appear in the method signature attribute of Cobertura XML Feb 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants