4 * This file is part of the Symfony package.
6 * (c) Fabien Potencier <fabien@symfony.com>
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
12 namespace Symfony\Component\Process\Tests;
14 use PHPUnit\Framework\TestCase;
15 use Symfony\Component\Process\ProcessUtils;
17 class ProcessUtilsTest extends TestCase
20 * @dataProvider dataArguments
22 public function testEscapeArgument($result, $argument)
24 $this->assertSame($result, ProcessUtils::escapeArgument($argument));
27 public function dataArguments()
29 if ('\\' === DIRECTORY_SEPARATOR) {
31 array('"\"php\" \"-v\""', '"php" "-v"'),
32 array('"foo bar"', 'foo bar'),
33 array('^%"path"^%', '%path%'),
34 array('"<|>\\" \\"\'f"', '<|>" "\'f'),
36 array('"with\trailingbs\\\\"', 'with\trailingbs\\'),
41 array("'\"php\" \"-v\"'", '"php" "-v"'),
42 array("'foo bar'", 'foo bar'),
43 array("'%path%'", '%path%'),
44 array("'<|>\" \"'\\''f'", '<|>" "\'f'),
46 array("'with\\trailingbs\\'", 'with\trailingbs\\'),
47 array("'withNonAsciiAccentLikeéÉèÈàÀöä'", 'withNonAsciiAccentLikeéÉèÈàÀöä'),