* * 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:----XoT9et0nKoTxjR0iBt00xn+REnkfi96zS1qxR2ISwI2JQ3MhBug6nPOXWbulCShQPIJTP3p3AlPLv+nZKMnHmWkdV1OPcyQ5rqbHkHinpmK+TJRo2peAj1fAH8BwcLJpHbZmm2HClCiz8jc0cNhY81uM10UpnTlMUKcoSzNotXV9elk835ovO/sW+6BHJnlmjSV4BaulprKz96Maig65DP6o7rvWzT8MnsCdjobItwoPz6W89XlQFdYEA2AprJ4t9zi3Vx1Epxh1UnmEATVY35XIqe/I24teUxYsI/EmoA38eCIHl5W/vp4hWwbAEdXXv+iMDqfPfjstublS3VOFmsgp5p352rgc8CEzW6UnAG3Hw4e1iRMIv3eIyWRLrBQQYUSo+Cc9mp8nqjtZyBpE/JL8K6G30OQLXpVDWXCIDooX9QdDtk4Huo48ZUB5DU86xupPDki5HV0mNuThddvaCaJDrKCCX4I/rXj8SEj/keS/ApGqTKkHV50QN4KiApHGXuFehnyz6TcJIpU5ma6H/ELPrpA/uQJPl7U/J+DhdNRaWsOZ1jZH1vqaC/rEYmFwGeHzWZAX9pX/K3mqlSWTv7+AhXLigcn6PKEDOiIspB2JT14n50Hqw5j71PuMSWV56Twxktkab4DmfPDuNunvUrQ9/B5prhggS6/LKyTRPNA=----ATTACHMENT:----Mjk5NzM4NDIwMTc4Njg5OCA1MzgwMzAwMDE0MDA1NTU3IDY1MDI1MTU5MTUyMDMwMTc=