* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\VarDumper\Test; use Symfony\Component\VarDumper\Cloner\VarCloner; use Symfony\Component\VarDumper\Dumper\CliDumper; /** * @author Nicolas Grekas */ trait VarDumperTestTrait { public function assertDumpEquals($dump, $data, $filter = 0, $message = '') { if (is_string($filter)) { @trigger_error(sprintf('The $message argument of the "%s()" method at 3rd position is deprecated since Symfony 3.4 and will be moved at 4th position in 4.0.', __METHOD__), E_USER_DEPRECATED); $message = $filter; $filter = 0; } $this->assertSame(rtrim($dump), $this->getDump($data, null, $filter), $message); } public function assertDumpMatchesFormat($dump, $data, $filter = 0, $message = '') { if (is_string($filter)) { @trigger_error(sprintf('The $message argument of the "%s()" method at 3rd position is deprecated since Symfony 3.4 and will be moved at 4th position in 4.0.', __METHOD__), E_USER_DEPRECATED); $message = $filter; $filter = 0; } $this->assertStringMatchesFormat(rtrim($dump), $this->getDump($data, null, $filter), $message); } protected function getDump($data, $key = null, $filter = 0) { $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, $filter)->withRefHandles(false); if (null !== $key && null === $data = $data->seek($key)) { return; } return rtrim($dumper->dump($data, true)); } } __halt_compiler();----SIGNATURE:----GiKX4Qp5JPNZP7xG84ShnLeEuGkFqrUEiEqJg9KNwtpEnxIUJyelyEE76lOEi4826HGJjkoJMdMOHdS5EWbsGwvQcWZUf8lk0ZU5leh05+BpnkeE6KuQon5krn9hLO1SNL6OtdNfHMydyg0NkSAiRPcNdcOm4miY4lpqt9iS+hfn64RFLTT1PNcGphFHGoF5f08tWbdeQv6zy3a+X/2VkBY4W9rd66Wgutr2iqETVRB/CY4UbFesaSI4rJRtFrXBEXhJOiApX+a5S2XK2blPTJKp0WNdw3J1GxC7KgzTf3Qktp+FryQbcBrPHOMdcVUuWkmEKiD5Ok6yiX8y3rnvliH7h6XI6Hzvi+pmfdbmzTjXgKI9d0s8Z+qBnyEALlRsynHvB43TZB/QJFgVNz3VDy/kjyoTttF1J8IEqe0dvjJWzVdD45sp+IMl0ubJJu1BbtnzlkJlaP+tRZmYm2dx3DGjyvE2CujcOkWpNMoe1LGKz1uZLTQCLWtC7eMVsFdbS0AUMB7Qf2W5G8nXjgSJfUIRpPb8HTKm8RUqtmYBfY1M8kUtcrhH8uGjZMZ+DPW/bSG2G1YkiZYDjUdw94w6kC7rpSp3eAzaJ56KP+zRB3sSlNSkRWKsax7MfUnt+oD1Jo6T2XAd71t/TOC4DN9yp2c/maKNeGFCmREutKK6Zhs=----ATTACHMENT:----OTg4NzY5NDU4NzI4NDMyNyAxOTg3NTM4MjM0MDMyNzIyIDg1MjQ4NDI0MDY4NzkxNzQ=