Skip to content
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

STDOUT/STDERR IO streams do not exist in process isolation #1348

Closed
wants to merge 1 commit into from

Conversation

sun
Copy link
Contributor

@sun sun commented Jul 24, 2014

The PHP CLI SAPI does not auto-register the standard IO streams when a script is piped into STDIN (which is the case in process isolation); cf.

When a test is executed without process isolation, then the STDOUT and STDERR streams are available. But if the test is executed in a separate process, then attempting to access the streams triggers a PHP Notice (undefined constant), followed by a PHP Warning (fopen).

A prominent example of affected code is e.g. vfsStream, which is an officially recommended/endorsed library for PHPUnit.

I'll add a regression test shortly.

The PHP CLI SAPI does not auto-register the standard IO streams when a script is piped into STDIN (which is the case in process isolation); cf.

- https://bugs.php.net/bug.php?id=43283
- http://php.net/manual/en/features.commandline.io-streams.php
- https://gist.github.com/sun/d02c242514c8f34bccdb
@sun
Copy link
Contributor Author

sun commented Jul 29, 2014

For consistency with recent, related PRs, I'll recreate this one against master, too.

In essence, PHPUnit 4.3 == Mature Process Isolation. (unless we're going to backport sooner)

@sun sun closed this Jul 29, 2014
@sun
Copy link
Contributor Author

sun commented Jul 29, 2014

Recreated for master, including regression test: #1366

sun added a commit to sun/drupal that referenced this pull request Aug 1, 2014
- Fix process isolation infinitely blocks on Windows.
  sebastianbergmann/phpunit#1340
- Fix standard IO streams are not defined in process isolation.
  sebastianbergmann/phpunit#1348
- Fix isolated child process leaks into parent process.
  sebastianbergmann/phpunit#1351
sun added a commit to sun/drupal that referenced this pull request Aug 1, 2014
- Fix process isolation infinitely blocks on Windows.
  sebastianbergmann/phpunit#1340
- Fix standard IO streams are not defined in process isolation.
  sebastianbergmann/phpunit#1348
- Fix isolated child process leaks into parent process.
  sebastianbergmann/phpunit#1351
sun added a commit to sun/drupal that referenced this pull request Aug 6, 2014
- Fix process isolation infinitely blocks on Windows.
  sebastianbergmann/phpunit#1340
- Fix standard IO streams are not defined in process isolation.
  sebastianbergmann/phpunit#1348
- Fix isolated child process leaks into parent process.
  sebastianbergmann/phpunit#1351
sun added a commit to sun/drupal that referenced this pull request Aug 6, 2014
- Fix process isolation infinitely blocks on Windows.
  sebastianbergmann/phpunit#1340
- Fix standard IO streams are not defined in process isolation.
  sebastianbergmann/phpunit#1348
- Fix isolated child process leaks into parent process.
  sebastianbergmann/phpunit#1351
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant