minor #28864 [Process] A test case for stringifying of Process arguments (vudaltsov)

This PR was merged into the 3.4 branch.

Discussion
----------

[Process] A test case for stringifying of Process arguments

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | for https://github.com/symfony/symfony/pull/28863
| License       | MIT
| Doc PR        |

Checks that non-string arguments passed to Process constructor are typecasted to string

Commits
-------

0d543428ad Add a test case for stringifying of Process arguments
This commit is contained in:
Nicolas Grekas 2018-10-14 11:39:46 -07:00
commit 55978d793f

View File

@ -1492,7 +1492,7 @@ class ProcessTest extends TestCase
$p = new Process(array(self::$phpBin, '-r', 'echo $argv[1];', $arg));
$p->run();
$this->assertSame($arg, $p->getOutput());
$this->assertSame((string) $arg, $p->getOutput());
}
/**
@ -1505,7 +1505,7 @@ class ProcessTest extends TestCase
$p->inheritEnvironmentVariables(false);
$p->run();
$this->assertSame($arg, $p->getOutput());
$this->assertSame((string) $arg, $p->getOutput());
}
public function testRawCommandLine()
@ -1535,6 +1535,9 @@ EOTXT;
yield array("a!b\tc");
yield array('a\\\\"\\"');
yield array('éÉèÈàÀöä');
yield array(null);
yield array(1);
yield array(1.1);
}
public function testEnvArgument()