Skip to content

Commit

Permalink
Added regression test for sebastianbergmann#1351.
Browse files Browse the repository at this point in the history
  • Loading branch information
sun committed Jul 25, 2014
1 parent c3a3544 commit bf39e30
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 0 deletions.
27 changes: 27 additions & 0 deletions tests/Regression/GitHub/1351.phpt
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.
21 changes: 21 additions & 0 deletions tests/Regression/GitHub/1351/Issue1351Test.php
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.');
}

}
4 changes: 4 additions & 0 deletions tests/Regression/GitHub/1351/UserData.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?php
class UserData
{
}

0 comments on commit bf39e30

Please sign in to comment.