-
-
Notifications
You must be signed in to change notification settings - Fork 155
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PhpProcess: Reset $_ENV if it is in use (#693)
* PhpProcess: Reset $_ENV if it is in use As of 1.3.2 xdebug-handler won't update $_ENV if it is in use. But Symfony's Process will happily import everything from $_ENV, hence we need to reset it just as xdebug-handler does. * Add missing phpunit.xml * Update PhpProcess.php
- Loading branch information
1 parent
add7355
commit a774020
Showing
9 changed files
with
114 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,7 @@ | ||
# Ensure Infection runs with non-empty `$_ENV` | ||
|
||
When `variables_order` set to constain an `E`, Infection should just work. | ||
|
||
https://github.com/infection/infection/issues/692 | ||
|
||
https://github.com/infection/infection/pull/693 |
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,15 @@ | ||
{ | ||
"require-dev": { | ||
"phpunit/phpunit": "^7.5" | ||
}, | ||
"autoload": { | ||
"psr-4": { | ||
"Variables_Order_EGPCS\\": "src/" | ||
} | ||
}, | ||
"autoload-dev": { | ||
"psr-4": { | ||
"Variables_Order_EGPCS\\Test\\": "tests/" | ||
} | ||
} | ||
} |
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,6 @@ | ||
Total: 1 | ||
Killed: 1 | ||
Errored: 0 | ||
Escaped: 0 | ||
Timed Out: 0 | ||
Not Covered: 0 |
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,12 @@ | ||
{ | ||
"timeout": 25, | ||
"source": { | ||
"directories": [ | ||
"src" | ||
] | ||
}, | ||
"logs": { | ||
"summary": "infection.log" | ||
}, | ||
"tmpDir": "." | ||
} |
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,18 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="./vendor/phpunit/phpunit/phpunit.xsd" | ||
bootstrap="./vendor/autoload.php" | ||
colors="true" | ||
> | ||
<testsuites> | ||
<testsuite name="Test Suite"> | ||
<directory>./tests/</directory> | ||
</testsuite> | ||
</testsuites> | ||
|
||
<filter> | ||
<whitelist> | ||
<directory>./src/</directory> | ||
</whitelist> | ||
</filter> | ||
</phpunit> |
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 @@ | ||
#!/usr/bin/env bash | ||
|
||
readonly INFECTION=../../../../bin/infection | ||
|
||
set -e pipefail | ||
|
||
if [ "$PHPDBG" = "1" ] | ||
then | ||
phpdbg -d variables_order=EGPCS -qrr $INFECTION | ||
else | ||
php -d variables_order=EGPCS $INFECTION | ||
fi | ||
|
||
diff -w expected-output.txt infection.log |
11 changes: 11 additions & 0 deletions
11
tests/Fixtures/e2e/Variables_Order_EGPCS/src/SourceClass.php
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,11 @@ | ||
<?php | ||
|
||
namespace Variables_Order_EGPCS; | ||
|
||
class SourceClass | ||
{ | ||
public function hello(): string | ||
{ | ||
return 'hello'; | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
tests/Fixtures/e2e/Variables_Order_EGPCS/tests/SourceClassTest.php
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,15 @@ | ||
<?php | ||
|
||
namespace Variables_Order_EGPCS\Test; | ||
|
||
use Variables_Order_EGPCS\SourceClass; | ||
use PHPUnit\Framework\TestCase; | ||
|
||
class SourceClassTest extends TestCase | ||
{ | ||
public function test_hello() | ||
{ | ||
$sourceClass = new SourceClass(); | ||
$this->assertSame('hello', $sourceClass->hello()); | ||
} | ||
} |