You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
488 public function run(PHPUnit_Framework_TestResult $result = NULL)
just to be able to judge if a test is actually a success and the output in STDERR buffer is just extra noise. I couldn't find a way as I said, because
a) PHPUnit_Util_PHP::runJob() is called within run()
b) after it's called, I have no way to intersect stderr returned by the result from test in separate process
Any help is really appreciated. Thank you.
The text was updated successfully, but these errors were encountered:
Since this is sort of a rare situation, I don't really think it warrants changes to the core libraries. You can actually handle this in a couple of different ways:
Trap STDERR in your application code. For me this makes the most sense. Then you can differentiate between actual errors and just noise in your application code and use your tests to ensure that your application is handling the errors correctly.
If you really must allow STDERR to bubble up through your tests, redirect it to STDOUT or to a file in your application code so that your tests can process it without triggering an error.
If neither of the above options work for you, as a last resort you can subclass PHPUnit_Framework_TestCase and call a version of PHPUnit_Util_PHP ::runJobs() that is customized for your exact specifications.
Hello,
I have been using PHPUnit and to be honest I really like it. I just had a question:
When running a test in process isolation:
===== SYSTEM UNDER TEST.php =====
==== TEST RUNNER FILE.php ======
====== OUTPUT =====
If there is anything written to the STDERR, the test is considered to be a failure. Is there any way to intersect line 179 in
excerpt from http://github.com/sebastianbergmann/phpunit/blob/3.5/PHPUnit/Util/PHP.php
I couldn't find a way to do this in an object oriented way. Could you allow a hook on line 605 of TestCase.php
excerpt from http://github.com/sebastianbergmann/phpunit/blob/3.5/PHPUnit/Framework/TestCase.php
I don't want to copy paste the entire run() method in TestCase.php in my class that extends PHPUnit_Framework_TestCase and modify line 605
excerpt from
http://github.com/sebastianbergmann/phpunit/blob/3.5/PHPUnit/Framework/TestCase.php
just to be able to judge if a test is actually a success and the output in STDERR buffer is just extra noise. I couldn't find a way as I said, because
a) PHPUnit_Util_PHP::runJob() is called within run()
b) after it's called, I have no way to intersect stderr returned by the result from test in separate process
Any help is really appreciated. Thank you.
The text was updated successfully, but these errors were encountered: