Opened 8 years ago
Last modified 5 years ago
#39237 new defect (bug)
PHPunit coverage reports fail if the is out to the stdout or header
Reported by: | pbearne | Owned by: | |
---|---|---|---|
Milestone: | Future Release | Priority: | normal |
Severity: | normal | Version: | |
Component: | Build/Test Tools | Keywords: | needs-patch dev-feedback |
Focuses: | Cc: |
Description (last modified by )
trying to get the coverage report to work :-)
https://phpunit.de/manual/current/en/textui.html
and their error due to the ech statements in the phpunit install.php
and bootstrap.php
i.e.
<?php echo "Installing..." . PHP_EOL;
and due to the header value been set in wp_redirect()
in pluggable.php
why this is running for unittest ???
it looks like we need to test for if a coverage report is been created and not echo to the console
Change History (13)
#4
@
8 years ago
- Keywords dev-feedback added
I noticed the same a while ago. It used to work, but perhaps something changed in PHPUnit.
@jorbin @netweb Maybe you guys have some ideas?
#5
@
8 years ago
It could that its the coverage reports.
Happy to provide patch for this but we will lose the current stdout if I do
#7
@
8 years ago
- Summary changed from PHPunint coverage reports fail if the is out to the stdout or header to PHPunit coverage reports fail if the is out to the stdout or header
#8
@
7 years ago
I think the underlying problem here is also preventing me from writing unit tests for export.
I'm trying to have something like the following in a unit test:
ob_start();
export_wp();
$wxr = ob_get_flush();
// $wxr should now contain the exported XML as a string
When export_wp()
calls header(...)
an exception is raised because "headers already sent".
Does anyone have a work around that I could use to get the output of an export?
#9
@
7 years ago
I think we need to add a flag so we don't output to stdout
or just remove them are they needed?
Paul
this might help here for a note http://stackoverflow.com/questions/6710418/how-to-display-underlying-tested-method-in-phpunit-tests