-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1366 from sun/cli-io-streams
STDOUT/STDERR IO streams do not exist in process isolation
- Loading branch information
Showing
3 changed files
with
61 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
--TEST-- | ||
GH-1348: STDOUT/STDERR IO streams should exist in process isolation | ||
--SKIPIF-- | ||
<?php | ||
if (defined('HHVM_VERSION')) | ||
print "skip: PHP runtime required"; | ||
?> | ||
--FILE-- | ||
<?php | ||
|
||
$_SERVER['argv'][1] = '--no-configuration'; | ||
$_SERVER['argv'][] = '--strict'; | ||
$_SERVER['argv'][] = '--process-isolation'; | ||
$_SERVER['argv'][] = 'Issue1348Test'; | ||
$_SERVER['argv'][] = __DIR__ . '/1348/Issue1348Test.php'; | ||
|
||
require __DIR__ . '/../../bootstrap.php'; | ||
PHPUnit_TextUI_Command::main(); | ||
?> | ||
--EXPECTF-- | ||
PHPUnit %s by Sebastian Bergmann. | ||
|
||
. | ||
STDOUT does not break test result | ||
E | ||
|
||
Time: %s, Memory: %sMb | ||
|
||
There was 1 error: | ||
|
||
1) Issue1348Test::testSTDERR | ||
PHPUnit_Framework_Exception: STDERR works as usual. | ||
|
||
FAILURES! | ||
Tests: 2, Assertions: 1, Errors: 1. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?php | ||
class Issue1348Test extends PHPUnit_Framework_TestCase | ||
{ | ||
public function testSTDOUT() | ||
{ | ||
fwrite(STDOUT, "\nSTDOUT does not break test result\n"); | ||
$this->assertTrue(true); | ||
} | ||
|
||
public function testSTDERR() | ||
{ | ||
fwrite(STDERR, 'STDERR works as usual.'); | ||
} | ||
} |