Methods named "class" are not handled correctly
Arcesilas opened this issue · comments
Q | A |
---|---|
php-code-coverage version | 7.0.7 |
PHP version | 7.3.8 |
Driver | Xdebug |
Xdebug version (if used) | 2.7.2 |
Installation Method | Composer |
Usage Method | PHPUnit |
PHPUnit version (if used) | 8.3.5 |
Example class:
<?php
namespace Ns;
class Foo
{
public function class()
{
return true;
}
}
Related test:
<?php
use Ns\Foo;
use PHPUnit\Framework\TestCase;
class FooTest extends TestCase
{
public function testClassMethod()
{
$foo = new Foo();
$this->assertTrue($foo->class());
}
}
Running the test:
$ vendor/bin/phpunit --filter=FooTest --coverage-text
PHPUnit 8.3.5 by Sebastian Bergmann and contributors.
. 1 / 1 (100%)
Time: 72 ms, Memory: 6.00 MB
OK (1 test, 1 assertion)
Generating code coverage report in HTML format ... done [47 ms]
Code Coverage Report:
2019-09-16 17:38:20
Summary:
Classes: 0.00% (0/7)
Methods: 0.00% (0/22)
Lines: 0.00% (0/39)
Edit
In the HTML report, the method is diplayed like this:
string\class | n/a | 0 / 0 | 1 | n/a | 0 / 0 |
---|