[wp-trac] [WordPress Trac] #39265: Missing @covers and @uses in the comments block in phpunt test for wordpress
WordPress Trac
noreply at wordpress.org
Tue Dec 13 14:41:01 UTC 2016
#39265: Missing @covers and @uses in the comments block in phpunt test for
wordpress
------------------------------+-----------------------------
Reporter: pbearne | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Build/Test Tools | Version: trunk
Severity: normal | Keywords:
Focuses: |
------------------------------+-----------------------------
PHPUnit has a comment block notation @cover and @uses that we are not
using so we can create coverage report to see how much of WordPress has
test
https://thephp.cc/news/2014/03/phpunit-4-0-code-coverage-improvements
http://blog.teamlazerbeez.com/2009/08/18/phpunit-annotations/#covers
https://phpunit.de/manual/current/en/appendixes.annotations.html#appendixes.annotations.covers
@covers tells PHPUnit that this test what the test function is testing
{{{
/**
* @covers Class_Name::function_name
*/
}}}
@uses tells PHPunit that the test is using another function to help test
the @covers function but this test is not testing it so it should ignore
it for the covers report
{{{
/**
* @covers Class_Name::function_name
* @uses Other function
*/
}}}
''note: if the @ covers function that is not in a class and in global
namespace then the notation is like this''
{{{
/**
* @covers ::function_name
*/
}}}
This ticket is place holder for how and what the changes need to be so
that we can encourage the fixing of this.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/39265>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list