-
-
Notifications
You must be signed in to change notification settings - Fork 377
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
Code Coverage XML report generate empty files #692
Comments
Looks like it's just the src/Service.phpnamespace Coverage\Example;
class Service
{
public function __construct()
{
new \SoapClient("api/.asmx?wsdl");
}
} tests/ServiceTest.phpnamespace Coverage\ExampleTests;
class ServiceTest extends \PHPUnit\Framework\TestCase
{
public function testGet(): void
{
$this->expectException(\Exception::class);
new \Coverage\Example\Service();
}
} |
This is indeed unrelated to PHPUnit (and Coverage) but a general PHP problem (imho, bug): try {
new \SoapClient("not-found.wsdl");
} catch (Throwable $t) {}
$dom = new DOMDocument();
$dom->loadxml('<?xml version="1.0" ?><root />');
var_dump($dom->save('/tmp/test.xml')); Running the above code outputs |
@sebastianbergmann I think for the time being the proposed workaround (read: PR) makes sense :) |
I have opened https://bugs.php.net/bug.php?id=79191 for the bug in PHP. |
If you plan to move back to |
For reference: The underlying PHP Bug has been fixed with PHP 7.4.3 and 7.3.15, respectively. Since 7.2 is in security bugs only mode, no fix there. No fixes for older versions of PHP as those are EOL. |
Target Class
Target TestCase
Command for generate Code Coverage XML Report
After executing comand, folder
build/coverage-xml
contains empty files.Other reports (HTML, Clover, PHP) works as expected.
Also reproduced on the previous version of
sebastianbergmann/php-code-coverage
.The text was updated successfully, but these errors were encountered: