Beispiel #1
0
 /**
  * @param string $input
  *
  * @return mixed
  */
 public function escape($input)
 {
     $this->dumper->dump($this->cloner->cloneVar($input), $this->memoryStream);
     $output = stream_get_contents($this->memoryStream, -1, 0);
     ftruncate($this->memoryStream, 0);
     return rtrim($output, "\n");
 }
 /**
  * Print dans la console les infos sur la variable en param.
  *
  * @param mixed $var
  *
  * @throws Exception
  */
 protected function dump($var)
 {
     if (null === $this->__dumper) {
         $this->__initDumper();
     }
     $this->__dumper->dump($this->__cloner->cloneVar($var));
 }
 public function testCollect()
 {
     $c = new RequestDataCollector();
     $c->collect($request = $this->createRequest(), $this->createResponse());
     $cloner = new VarCloner();
     $attributes = $c->getRequestAttributes();
     $this->assertSame('request', $c->getName());
     $this->assertInstanceOf('Symfony\\Component\\HttpFoundation\\HeaderBag', $c->getRequestHeaders());
     $this->assertInstanceOf('Symfony\\Component\\HttpFoundation\\ParameterBag', $c->getRequestServer());
     $this->assertInstanceOf('Symfony\\Component\\HttpFoundation\\ParameterBag', $c->getRequestCookies());
     $this->assertInstanceOf('Symfony\\Component\\HttpFoundation\\ParameterBag', $attributes);
     $this->assertInstanceOf('Symfony\\Component\\HttpFoundation\\ParameterBag', $c->getRequestRequest());
     $this->assertInstanceOf('Symfony\\Component\\HttpFoundation\\ParameterBag', $c->getRequestQuery());
     $this->assertSame('html', $c->getFormat());
     $this->assertEquals('foobar', $c->getRoute());
     $this->assertEquals($cloner->cloneVar(array('name' => 'foo')), $c->getRouteParams());
     $this->assertSame(array(), $c->getSessionAttributes());
     $this->assertSame('en', $c->getLocale());
     $this->assertEquals($cloner->cloneVar($request->attributes->get('resource')), $attributes->get('resource'));
     $this->assertEquals($cloner->cloneVar($request->attributes->get('object')), $attributes->get('object'));
     $this->assertInstanceOf('Symfony\\Component\\HttpFoundation\\HeaderBag', $c->getResponseHeaders());
     $this->assertSame('OK', $c->getStatusText());
     $this->assertSame(200, $c->getStatusCode());
     $this->assertSame('application/json', $c->getContentType());
 }
 /**
  * @param $variable
  * @return resource|string
  * @throws Exception
  * @throws null
  */
 protected function dump($variable)
 {
     $output = fopen('php://memory', 'r+b');
     $this->dumper->dump($this->cloner->cloneVar($variable), $output);
     rewind($output);
     $output = stream_get_contents($output);
     return $output;
 }
 /**
  * Describe a View Composer for logging.
  * @param View $view    View being created
  * @param mixed $viewComposer   View Composer
  * @return string
  */
 protected function describeViewComposer(View $view, $viewComposer)
 {
     $description = "View Composer called for view '{$view->name()}': ";
     $this->cliDumper->dump($this->varCloner->cloneVar($viewComposer), function ($line, $depth) use(&$description) {
         $description .= "{$line} ";
     });
     return $description;
 }
 public function __invoke($var)
 {
     ob_start();
     $this->dumper->dump($this->cloner->cloneVar($var));
     $result = ob_get_contents();
     ob_end_clean();
     return $result;
 }
 public function testCollect()
 {
     $cloner = new VarCloner();
     $collectedMessages = array(array('id' => 'foo', 'translation' => 'foo (en)', 'locale' => 'en', 'domain' => 'messages', 'state' => DataCollectorTranslator::MESSAGE_DEFINED, 'parameters' => array(), 'transChoiceNumber' => null), array('id' => 'bar', 'translation' => 'bar (fr)', 'locale' => 'fr', 'domain' => 'messages', 'state' => DataCollectorTranslator::MESSAGE_EQUALS_FALLBACK, 'parameters' => array(), 'transChoiceNumber' => null), array('id' => 'choice', 'translation' => 'choice', 'locale' => 'en', 'domain' => 'messages', 'state' => DataCollectorTranslator::MESSAGE_MISSING, 'parameters' => array('%count%' => 3), 'transChoiceNumber' => 3), array('id' => 'choice', 'translation' => 'choice', 'locale' => 'en', 'domain' => 'messages', 'state' => DataCollectorTranslator::MESSAGE_MISSING, 'parameters' => array('%count%' => 3), 'transChoiceNumber' => 3), array('id' => 'choice', 'translation' => 'choice', 'locale' => 'en', 'domain' => 'messages', 'state' => DataCollectorTranslator::MESSAGE_MISSING, 'parameters' => array('%count%' => 4, '%foo%' => 'bar'), 'transChoiceNumber' => 4));
     $expectedMessages = array(array('id' => 'foo', 'translation' => 'foo (en)', 'locale' => 'en', 'domain' => 'messages', 'state' => DataCollectorTranslator::MESSAGE_DEFINED, 'count' => 1, 'parameters' => array(), 'transChoiceNumber' => null), array('id' => 'bar', 'translation' => 'bar (fr)', 'locale' => 'fr', 'domain' => 'messages', 'state' => DataCollectorTranslator::MESSAGE_EQUALS_FALLBACK, 'count' => 1, 'parameters' => array(), 'transChoiceNumber' => null), array('id' => 'choice', 'translation' => 'choice', 'locale' => 'en', 'domain' => 'messages', 'state' => DataCollectorTranslator::MESSAGE_MISSING, 'count' => 3, 'parameters' => array($cloner->cloneVar(array('%count%' => 3)), $cloner->cloneVar(array('%count%' => 3)), $cloner->cloneVar(array('%count%' => 4, '%foo%' => 'bar'))), 'transChoiceNumber' => 3));
     $translator = $this->getTranslator();
     $translator->expects($this->any())->method('getCollectedMessages')->will($this->returnValue($collectedMessages));
     $dataCollector = new TranslationDataCollector($translator);
     $dataCollector->lateCollect();
     $this->assertEquals(1, $dataCollector->getCountMissings());
     $this->assertEquals(1, $dataCollector->getCountFallbacks());
     $this->assertEquals(1, $dataCollector->getCountDefines());
     $this->assertEquals($expectedMessages, array_values($dataCollector->getMessages()));
 }
Beispiel #8
0
 /**
  * @param $data
  * @param null|int $flags
  */
 public function dump($data, $flags = null)
 {
     if ($flags !== null) {
         if ($flags & self::NEWLINE_BEFORE) {
             $this->output->writeln('');
         }
     }
     $this->cliDumper->dump($this->varCloner->cloneVar($data));
     if ($flags !== null) {
         if ($flags & self::NEWLINE_AFTER) {
             $this->output->writeln('');
         }
     }
 }
Beispiel #9
0
 public function testCloneVarStringWithScheme()
 {
     $c = new CloneVarDataCollector('scheme://foo');
     $c->collect(new Request(), new Response());
     $cloner = new VarCloner();
     $this->assertEquals($cloner->cloneVar('scheme://foo'), $c->getData());
 }
Beispiel #10
0
 /**
  * @param string          $targetUrl   target url to import resource into
  * @param string          $file        path to file being loaded
  * @param OutputInterface $output      output of the command
  * @param Document        $doc         document to load
  * @param string          $host        host to import into
  * @param string          $rewriteHost string to replace with value from $host during loading
  * @param string          $rewriteTo   string to replace value from $rewriteHost with during loading
  * @param boolean         $sync        send requests syncronously
  *
  * @return Promise\Promise|null
  */
 protected function importResource($targetUrl, $file, OutputInterface $output, Document $doc, $host, $rewriteHost, $rewriteTo, $sync = false)
 {
     $content = str_replace($rewriteHost, $rewriteTo, $doc->getContent());
     $successFunc = function (ResponseInterface $response) use($output) {
         $output->writeln('<comment>Wrote ' . $response->getHeader('Link')[0] . '</comment>');
     };
     $errFunc = function (RequestException $e) use($output, $file) {
         $output->writeln('<error>' . str_pad(sprintf('Failed to write <%s> from \'%s\' with message \'%s\'', $e->getRequest()->getUri(), $file, $e->getMessage()), 140, ' ') . '</error>');
         if ($output->getVerbosity() >= OutputInterface::VERBOSITY_VERBOSE) {
             $this->dumper->dump($this->cloner->cloneVar($this->parser->parse($e->getResponse()->getBody(), false, false, true)), function ($line, $depth) use($output) {
                 if ($depth > 0) {
                     $output->writeln('<error>' . str_pad(str_repeat('  ', $depth) . $line, 140, ' ') . '</error>');
                 }
             });
         }
     };
     if ($sync === false) {
         $promise = $this->client->requestAsync('PUT', $targetUrl, ['json' => $this->parseContent($content, $file)]);
         $promise->then($successFunc, $errFunc);
     } else {
         $promise = new Promise\Promise();
         try {
             $promise->resolve($successFunc($this->client->request('PUT', $targetUrl, ['json' => $this->parseContent($content, $file)])));
         } catch (BadResponseException $e) {
             $promise->resolve($errFunc($e));
         }
     }
     return $promise;
 }
Beispiel #11
0
 /**
  * @param mixed $var
  */
 function appendLog($var)
 {
     static $handler = null;
     if ($handler === null) {
         $logDir = LOG_DIR;
         assert(is_dir($logDir), 'log dir "' . $logDir . '" must be a dir');
         $logDir .= '/' . date('Ymd');
         if (!is_dir($logDir)) {
             $success = mkdir($logDir);
             assert($success, 'log dir create failed: ' . $logDir . ': ' . json_encode(error_get_last()));
         }
         $logFile = $logDir . '/' . GAME_VERSION;
         $cloner = new VarCloner();
         $dumper = new CliDumper($logFile);
         $handler = function ($var) use($cloner, $dumper) {
             $dumper->dump($cloner->cloneVar($var));
         };
     }
     $origHandler = VarDumper::setHandler($handler);
     VarDumper::dump(date('c'));
     foreach (func_get_args() as $var) {
         VarDumper::dump($var);
     }
     VarDumper::setHandler($origHandler);
 }
 /**
  * Renders data.
  *
  * @return string
  */
 public function render()
 {
     $cloner = new VarCloner();
     $dumper = 'cli' === PHP_SAPI ? new CliDumper() : new HtmlDumper();
     $output = fopen('php://memory', 'r+b');
     $dumper->dump($cloner->cloneVar($this->getData()), $output);
     return stream_get_contents($output, -1, 0);
 }
Beispiel #13
0
 public function boot(Application $app)
 {
     VarDumper::setHandler(function ($var) {
         $cloner = new VarCloner();
         $dumper = 'cli' === PHP_SAPI ? new CliDumper() : new HtmlDumper();
         $dumper->dump($cloner->cloneVar($var));
     });
 }
Beispiel #14
0
 public function geny_dump($data)
 {
     $stream = fopen('php://memory', 'r+b');
     $dumper = new HtmlDumper($stream);
     $cloner = new VarCloner();
     $dumper->dump($cloner->cloneVar($data));
     rewind($stream);
     return stream_get_contents($stream);
 }
 /**
  * {@inheritdoc}
  */
 public function format($response)
 {
     $temp = tmpfile();
     $cloner = new VarCloner();
     $dumper = new CliDumper($temp);
     $dumper->dump($cloner->cloneVar($response));
     fseek($temp, 0);
     $response = stream_get_contents($temp);
     fclose($temp);
     return $response;
 }
 private function getVarDumperDump($data)
 {
     $h = fopen('php://memory', 'r+b');
     $cloner = new VarCloner();
     $dumper = new CliDumper($h);
     $dumper->setColors(false);
     $dumper->dump($cloner->cloneVar($data)->withRefHandles(false));
     $data = stream_get_contents($h, -1, 0);
     fclose($h);
     return rtrim($data);
 }
Beispiel #17
0
 public static function dump($var)
 {
     if (null === self::$handler) {
         $cloner = new VarCloner();
         $dumper = 'cli' === PHP_SAPI ? new CliDumper() : new HtmlDumper();
         self::$handler = function ($var) use($cloner, $dumper) {
             $dumper->dump($cloner->cloneVar($var));
         };
     }
     return call_user_func(self::$handler, $var);
 }
 /**
  * It dumps the contents of the given variable. It tries several dumpers in
  * turn (VarDumper component, Yaml::dump, etc.) and if none is available, it
  * falls back to PHP's var_export().
  *
  * @param mixed $variable
  *
  * @return string
  */
 public function dump($variable)
 {
     if (class_exists('Symfony\\Component\\VarDumper\\Dumper\\HtmlDumper')) {
         $cloner = new VarCloner();
         $dumper = new HtmlDumper();
         return $dumper->dump($cloner->cloneVar($variable));
     } elseif (class_exists('Symfony\\Component\\Yaml\\Yaml')) {
         return sprintf('<pre class="sf-dump">%s</pre>', Yaml::dump((array) $variable, 1024));
     } else {
         return sprintf('<pre class="sf-dump">%s</pre>', var_export($variable, true));
     }
 }
Beispiel #19
0
 public static function dumper($obj)
 {
     ob_start();
     $cloner = new VarCloner();
     $dumper = new HtmlDumper();
     self::$handler = function ($obj) use($cloner, $dumper) {
         $dumper->dump($cloner->cloneVar($obj));
     };
     call_user_func(self::$handler, $obj);
     $ret = ob_get_contents();
     ob_end_clean();
     return $ret;
 }
Beispiel #20
0
 protected function getDump($data, $key = null)
 {
     $flags = getenv('DUMP_LIGHT_ARRAY') ? CliDumper::DUMP_LIGHT_ARRAY : 0;
     $flags |= getenv('DUMP_STRING_LENGTH') ? CliDumper::DUMP_STRING_LENGTH : 0;
     $cloner = new VarCloner();
     $cloner->setMaxItems(-1);
     $dumper = new CliDumper(null, null, $flags);
     $dumper->setColors(false);
     $data = $cloner->cloneVar($data)->withRefHandles(false);
     if (null !== $key && null === ($data = $data->seek($key))) {
         return;
     }
     return rtrim($dumper->dump($data, true));
 }
 protected function getDump($data)
 {
     $flags = getenv('DUMP_LIGHT_ARRAY') ? CliDumper::DUMP_LIGHT_ARRAY : 0;
     $flags |= getenv('DUMP_STRING_LENGTH') ? CliDumper::DUMP_STRING_LENGTH : 0;
     $h = fopen('php://memory', 'r+b');
     $cloner = new VarCloner();
     $cloner->setMaxItems(-1);
     $dumper = new CliDumper($h, null, $flags);
     $dumper->setColors(false);
     $dumper->dump($cloner->cloneVar($data)->withRefHandles(false));
     $data = stream_get_contents($h, -1, 0);
     fclose($h);
     return rtrim($data);
 }
 /**
  * Format the given value into a human readable string.
  *
  * @param  mixed $value
  * @return string
  */
 public function dump($value)
 {
     if (class_exists('Symfony\\Component\\VarDumper\\Cloner\\VarCloner')) {
         static $dumper = null;
         // re-use the same var-dumper instance, so it won't re-render the global styles/scripts on each dump.
         if (!$dumper) {
             $dumper = new HtmlDumper();
             $styles = array('default' => '', 'num' => '', 'const' => '', 'str' => '', 'note' => '', 'ref' => '', 'public' => '', 'protected' => '', 'private' => '', 'meta' => '', 'key' => '', 'index' => '');
             $dumper->setStyles($styles);
         }
         $cloner = new VarCloner();
         return $dumper->dump($cloner->cloneVar($value));
     }
     return print_r($value, true);
 }
 /**
  * It dumps the contents of the given variable. It tries several dumpers in
  * turn (VarDumper component, Yaml::dump, etc.) and if none is available, it
  * falls back to PHP's var_export().
  *
  * @param mixed $variable
  *
  * @return string
  */
 public function dump($variable)
 {
     $dumpedData = '';
     if (class_exists('Symfony\\Component\\VarDumper\\Dumper\\HtmlDumper')) {
         $cloner = new VarCloner();
         $dumper = new HtmlDumper();
         $dumper->dump($cloner->cloneVar($variable), $output = fopen('php://memory', 'r+b'));
         $dumpedData = stream_get_contents($output, -1, 0);
     } elseif (class_exists('Symfony\\Component\\Yaml\\Yaml')) {
         $dumpedData = sprintf('<pre class="sf-dump">%s</pre>', Yaml::dump((array) $variable, 1024));
     } else {
         $dumpedData = sprintf('<pre class="sf-dump">%s</pre>', var_export($variable, true));
     }
     return $dumpedData;
 }
 /**
  * Converts the variable into a serializable Data instance.
  *
  * @param mixed $var
  *
  * @return Data
  */
 private function cloneVar($var)
 {
     if (null === $this->cloner) {
         $this->cloner = new VarCloner();
         $this->cloner->addCasters(array(Stub::class => function (Stub $v, array $a, Stub $s, $isNested) {
             return $isNested ? $a : StubCaster::castStub($v, $a, $s, true);
         }, \Exception::class => function (\Exception $e, array $a, Stub $s) {
             if (isset($a[$k = "Exceptionprevious"])) {
                 unset($a[$k]);
                 ++$s->cut;
             }
             return $a;
         }, FormInterface::class => function (FormInterface $f, array $a) {
             return array(Caster::PREFIX_VIRTUAL . 'name' => $f->getName(), Caster::PREFIX_VIRTUAL . 'type_class' => new ClassStub(get_class($f->getConfig()->getType()->getInnerType())));
         }, ConstraintViolationInterface::class => function (ConstraintViolationInterface $v, array $a) {
             return array(Caster::PREFIX_VIRTUAL . 'root' => $v->getRoot(), Caster::PREFIX_VIRTUAL . 'path' => $v->getPropertyPath(), Caster::PREFIX_VIRTUAL . 'value' => $v->getInvalidValue());
         }));
     }
     return $this->cloner->cloneVar($var);
 }
Beispiel #25
0
 private function execute($input)
 {
     $input = trim($input);
     if (empty($input)) {
         return;
     }
     $args = array_filter(explode(' ', $input));
     if (count($args) === 1 and array_key_exists($args[0], $this->currentLevel['content'])) {
         $this->execute("cd' {$args[0]}");
         return;
     }
     switch ($args[0]) {
         case 'ls':
             $this->output($this->ls());
             break;
         case 'cd':
             if (strpos($args[1], '/')) {
                 foreach (explode('/', $args[1]) as $arg) {
                     $this->execute("cd {$arg}");
                 }
                 break;
             }
             $item = str_replace('/', '', $args[1]);
             if ($item === '..') {
                 array_pop($this->levels);
                 $this->currentLevel = $this->parent();
                 break;
             } elseif ($item === '/') {
                 $this->levels = [$this->commands['content']['name']];
                 $this->currentLevel = $this->commands;
                 break;
             } elseif (array_key_exists($item, $this->currentLevel['content'])) {
                 array_push($this->levels, $item);
                 $this->currentLevel = $this->currentLevel['content'][$item];
                 break;
             } elseif ($item === '.') {
                 break;
             } else {
                 $this->output("Error: {$item} not found.\n");
                 break;
             }
         case 'exec':
             if (!isset($args[1])) {
                 $this->output("'exec' requires current element to be a command. Select one by 'cd'\n");
                 return;
             }
             $method = new \ReflectionMethod($this->levels[count($this->levels) - 2], $this->currentLevel['name']);
             $cmd = $method->invokeArgs(null, array_slice($args, 1));
             $this->client->send($cmd);
             $cloner = new VarCloner();
             $dumper = new CliDumper();
             $dumper->dump($cloner->cloneVar($this->client->getResponse()));
             break;
         case '?':
             $this->output("======== Available commands ========\n");
             $this->output(" - ls       : List available objects\n");
             $this->output(" - cd       : Change current directory ('cd ..' works)\n");
             $this->output(" - exec     : Execute current command eg: exec param1 param2 param3\n");
             $this->output(" - history  : Show command history\n");
             $this->output(" - quit     : Show command history\n");
             $this->output(" - ?        : Show this menu.....\n");
             break;
         case 'history':
             $this->output('  * ' . implode("\n  * ", array_values($this->history)) . "\n");
             break;
         case '':
             $this->prompt();
             break;
         case 'q':
         case 'quit':
             $this->client->logout();
             exit(0);
             break;
         default:
             $this->output("Error: Command not found for '{$input}'\n");
             $this->execute('?');
             $this->prompt();
     }
 }
 private function htmlEncode($s)
 {
     $html = '';
     $dumper = new HtmlDumper(function ($line) use(&$html) {
         $html .= $line;
     }, $this->charset);
     $dumper->setDumpHeader('');
     $dumper->setDumpBoundaries('', '');
     $cloner = new VarCloner();
     $dumper->dump($cloner->cloneVar($s));
     return substr(strip_tags($html), 1, -1);
 }
    public function testCharset()
    {
        if (!extension_loaded('mbstring')) {
            $this->markTestSkipped('This test requires mbstring.');
        }
        $var = mb_convert_encoding('Словарь', 'CP1251', 'UTF-8');
        $dumper = new HtmlDumper('php://output', 'CP1251');
        $dumper->setDumpHeader('<foo></foo>');
        $dumper->setDumpBoundaries('<bar>', '</bar>');
        $cloner = new VarCloner();
        $data = $cloner->cloneVar($var);
        $out = fopen('php://memory', 'r+b');
        $dumper->dump($data, $out);
        rewind($out);
        $out = stream_get_contents($out);
        $this->assertStringMatchesFormat(<<<EOTXT
<foo></foo><bar>b"<span class=sf-dump-str title="7 binary or non-UTF-8 characters">&#1057;&#1083;&#1086;&#1074;&#1072;&#1088;&#1100;</span>"
</bar>

EOTXT
, $out);
    }
Beispiel #28
0
    public function testHtmlDump()
    {
        $e = $this->getTestException(1);
        ExceptionCaster::$srcContext = -1;
        $cloner = new VarCloner();
        $cloner->setMaxItems(1);
        $dumper = new HtmlDumper();
        $dumper->setDumpHeader('<foo></foo>');
        $dumper->setDumpBoundaries('<bar>', '</bar>');
        $dump = $dumper->dump($cloner->cloneVar($e)->withRefHandles(false), true);
        $expectedDump = <<<'EODUMP'
<foo></foo><bar><span class=sf-dump-note>Exception</span> {<samp>
  #<span class=sf-dump-protected title="Protected property">message</span>: "<span class=sf-dump-str title="3 characters">foo</span>"
  #<span class=sf-dump-protected title="Protected property">code</span>: <span class=sf-dump-num>0</span>
  #<span class=sf-dump-protected title="Protected property">file</span>: "<span class=sf-dump-str title="%sExceptionCasterTest.php
%d characters"><span class=sf-dump-ellipsis>%sTests</span>%eCaster%eExceptionCasterTest.php</span>"
  #<span class=sf-dump-protected title="Protected property">line</span>: <span class=sf-dump-num>25</span>
  -<span class=sf-dump-private title="Private property defined in class:&#10;`Exception`">trace</span>: {<samp>
    <span class=sf-dump-meta title="%sExceptionCasterTest.php
Stack level %d."><span class=sf-dump-ellipsis>%sVarDumper%eTests</span>%eCaster%eExceptionCasterTest.php</span>: <span class=sf-dump-num>25</span>
     &hellip;12
  </samp>}
</samp>}
</bar>
EODUMP;
        $this->assertStringMatchesFormat($expectedDump, $dump);
    }
Beispiel #29
0
    /**
     * @runInSeparateProcess
     * @preserveGlobalState disabled
     */
    public function testBuggyRefs()
    {
        if (PHP_VERSION_ID >= 50600) {
            $this->markTestSkipped('PHP 5.6 fixed refs counting');
        }
        $var = $this->getSpecialVars();
        $var = $var[0];
        $dumper = new CliDumper();
        $dumper->setColors(false);
        $cloner = new VarCloner();
        $data = $cloner->cloneVar($var)->withMaxDepth(3);
        $out = '';
        $dumper->dump($data, function ($line, $depth) use(&$out) {
            if ($depth >= 0) {
                $out .= str_repeat('  ', $depth) . $line . "\n";
            }
        });
        $this->assertSame(<<<EOTXT
array:1 [
  0 => array:1 [
    0 => array:1 [
      0 => array:1 [ …1]
    ]
  ]
]

EOTXT
, $out);
    }
    public function testCaster()
    {
        $cloner = new VarCloner(array('*' => function ($obj, $array) {
            return array('foo' => 123);
        }, __CLASS__ => function ($obj, $array) {
            ++$array['foo'];
            return $array;
        }));
        $clone = $cloner->cloneVar($this);
        $expected = <<<EOTXT
Symfony\\Component\\VarDumper\\Cloner\\Data Object
(
    [data:Symfony\\Component\\VarDumper\\Cloner\\Data:private] => Array
        (
            [0] => Array
                (
                    [0] => Symfony\\Component\\VarDumper\\Cloner\\Stub Object
                        (
                            [type] => object
                            [class] => %s
                            [value] => 
                            [cut] => 0
                            [handle] => %i
                            [refCount] => 0
                            [position] => 1
                        )

                )

            [1] => Array
                (
                    [foo] => 124
                )

        )

    [maxDepth:Symfony\\Component\\VarDumper\\Cloner\\Data:private] => 20
    [maxItemsPerDepth:Symfony\\Component\\VarDumper\\Cloner\\Data:private] => -1
    [useRefHandles:Symfony\\Component\\VarDumper\\Cloner\\Data:private] => -1
)

EOTXT;
        $this->assertStringMatchesFormat($expected, print_r($clone, true));
    }