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 #1248 from Nikoms/issue1216
Fix #1216 with unit test
- Loading branch information
Showing
5 changed files
with
58 additions
and
5 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,27 @@ | ||
--TEST-- | ||
GH-1216: PHPUnit bootstrap must take globals vars even when the file is specified in command line | ||
--FILE-- | ||
<?php | ||
|
||
$_SERVER['argv'][1] = '--configuration'; | ||
$_SERVER['argv'][2] = dirname(__FILE__).'/1216/phpunit1216.xml'; | ||
$_SERVER['argv'][3] = '--debug'; | ||
$_SERVER['argv'][4] = '--bootstrap'; | ||
$_SERVER['argv'][5] = dirname(__FILE__).'/1216/bootstrap1216.php'; | ||
$_SERVER['argv'][6] = dirname(__FILE__) . '/1216/Issue1216Test.php'; | ||
|
||
require __DIR__ . '/../../bootstrap.php'; | ||
PHPUnit_TextUI_Command::main(); | ||
?> | ||
--EXPECTF-- | ||
PHPUnit %s by Sebastian Bergmann. | ||
|
||
Configuration read from %s | ||
|
||
|
||
Starting test 'Issue1216Test::testConfigAvailableInBootstrap'. | ||
. | ||
|
||
Time: %s ms, Memory: %sMb | ||
|
||
OK (1 test, 1 assertion) |
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,8 @@ | ||
<?php | ||
class Issue1216Test extends PHPUnit_Framework_TestCase | ||
{ | ||
public function testConfigAvailableInBootstrap() | ||
{ | ||
$this->assertTrue($_ENV['configAvailableInBootstrap']); | ||
} | ||
} |
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,2 @@ | ||
<?php | ||
$_ENV['configAvailableInBootstrap'] = isset($_ENV['loadedFromConfig']); |
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,8 @@ | ||
<phpunit> | ||
<testsuite name="Github issue 1216"> | ||
<file>Issue1216Test.php</file> | ||
</testsuite> | ||
<php> | ||
<env name="loadedFromConfig" value="1"/> | ||
</php> | ||
</phpunit> |