* * 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:----SQz9EVi5lbimk0EjXtLIwzYiuOsKTywBHLyxXfvR9IsKStQKtzZAXBfpJudoGe/Dmgp0KFMMOPDILe0u+3LRP1htD4jO28pllfjP1Fj4jcyaagdA/G32TA+TdI01TJvCQlFkK6ENx7o0fH2MuQKxa2036HrqD9KiKcTMJzIgzrybhgjwtSvh/xItvVhZg0nIw2CHuyGQpt7V2AS5pwNQlKhFhgHM8QsgnMsPxAmtIpmYjuSJq9SYAh7+6LJIzookgVOejYGrHV/3sSCqxebJMBOS9c4TG5H5X0o+qprv036xcxQp1DhHgAMSZjfAZpaZmstxwrAM/qCt2xxA0l8WzPv3dsNIBac5/sswnT6Fe+rw4A8iuk6eobOykzFfJ9530TeEJO3ah6nRX9owqZFSaDloMmfIFu67vyD25cey2zIfH/DIjRG6TJvTjRX198o7gAq1jnu9kRygtevcNuPuiyVwxMpAqQLN9o2oiyY2lyUG8/X6HebQ+vKAltvxbSxTAVMx75iuy1NpT2niNefRmVLuGKDdqD+4uESEmihnIR94Afm945qoQZAgFPlYS654lNNzczSZDzlW3T7bF7EvvdyOEVqa3V/0A0d3IeG1HljJEw/sAawYFbEUYkf/UlpPYofiw0lHgZQqA2GyQKo/uo9ZtAaUcfKmR8tsARv3AJ4=----ATTACHMENT:----MjI1NTU2NTMyNjM1OTAzNSAzNDc0Mzc4MTM4NTAzNjkgMjUzMDI5NDQ0NTI5MTMyNA==