PHP 8.2.30
Preview: ProcessUtilsTest.php Size: 1.33 KB
/proc/self/root/opt/alt/php53/usr/share/pear/test/Process/Symfony/Component/Process/Tests/ProcessUtilsTest.php

<?php

/*
 * This file is part of the Symfony package.
 *
 * (c) Fabien Potencier <fabien@symfony.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Symfony\Component\Process\Tests;

use Symfony\Component\Process\ProcessUtils;

class ProcessUtilsTest extends \PHPUnit_Framework_TestCase
{
    /**
     * @dataProvider dataArguments
     */
    public function testEscapeArgument($result, $argument)
    {
        $this->assertSame($result, ProcessUtils::escapeArgument($argument));
    }

    public function dataArguments()
    {
        if (defined('PHP_WINDOWS_VERSION_BUILD')) {
            return array(
                array('"\"php\" \"-v\""', '"php" "-v"'),
                array('"foo bar"', 'foo bar'),
                array('^%"path"^%', '%path%'),
                array('"<|>\\" \\"\'f"', '<|>" "\'f'),
                array('""', ''),
                array('"with\trailingbs\\\\"', 'with\trailingbs\\'),
            );
        }

        return array(
            array("'\"php\" \"-v\"'", '"php" "-v"'),
            array("'foo bar'", 'foo bar'),
            array("'%path%'", '%path%'),
            array("'<|>\" \"'\\''f'", '<|>" "\'f'),
            array("''", ''),
            array("'with\\trailingbs\\'", 'with\trailingbs\\'),
        );
    }
}

Directory Contents

Dirs: 0 × Files: 13

Name Size Perms Modified Actions
26.07 KB lrw-r--r-- 2019-12-18 11:20:42
Edit Download
812 B lrw-r--r-- 2019-12-18 11:20:42
Edit Download
1.83 KB lrw-r--r-- 2019-12-18 11:20:42
Edit Download
673 B lrw-r--r-- 2019-12-18 11:20:42
Edit Download
1.51 KB lrw-r--r-- 2019-12-18 11:20:42
Edit Download
5.86 KB lrw-r--r-- 2019-12-18 11:20:42
Edit Download
2.64 KB lrw-r--r-- 2019-12-18 11:20:42
Edit Download
453 B lrw-r--r-- 2019-12-18 11:20:42
Edit Download
1.33 KB lrw-r--r-- 2019-12-18 11:20:42
Edit Download
7.92 KB lrw-r--r-- 2019-12-18 11:20:42
Edit Download
4.34 KB lrw-r--r-- 2019-12-18 11:20:42
Edit Download
254 B lrw-r--r-- 2019-12-18 11:20:42
Edit Download
6.24 KB lrw-r--r-- 2019-12-18 11:20:42
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).