forked from sebastianbergmann/phpunit
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added regression test for sebastianbergmann#1351.
- Loading branch information
Showing
3 changed files
with
52 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
--TEST-- | ||
GH-1351: Test result does not serialize test class in process isolation | ||
--FILE-- | ||
<?php | ||
|
||
$_SERVER['argv'][1] = '--no-configuration'; | ||
$_SERVER['argv'][2] = '--process-isolation'; | ||
$_SERVER['argv'][3] = 'Issue1351Test'; | ||
$_SERVER['argv'][4] = __DIR__ . '/1351/Issue1351Test.php'; | ||
|
||
require __DIR__ . '/../../bootstrap.php'; | ||
PHPUnit_TextUI_Command::main(); | ||
?> | ||
--EXPECTF-- | ||
PHPUnit %s by Sebastian Bergmann. | ||
|
||
F. | ||
|
||
Time: %s, Memory: %sMb | ||
|
||
There was 1 failure: | ||
|
||
1) Issue1351Test::testChildProcessDoesNotLeakPre | ||
Expected failure. | ||
%A | ||
FAILURES! | ||
Tests: 2, Assertions: 3, Failures: 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,21 @@ | ||
<?php | ||
class Issue1351Test extends PHPUnit_Framework_TestCase | ||
{ | ||
protected $instance; | ||
|
||
/** | ||
* @runInSeparateProcess | ||
*/ | ||
public function testChildProcessDoesNotLeakPre() | ||
{ | ||
$this->instance = new UserData(); | ||
$this->assertFalse(TRUE, 'Expected failure.'); | ||
} | ||
|
||
public function testChildProcessDoesNotLeakPost() | ||
{ | ||
$this->assertNull($this->instance); | ||
$this->assertFalse(class_exists('UserData', false), 'Class of child process does not exist.'); | ||
} | ||
|
||
} |
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,4 @@ | ||
<?php | ||
class UserData | ||
{ | ||
} |