use Symfony\Component\VarDumper\Dumper\CliDumper;
use Symfony\Component\VarDumper\Dumper\ContextProvider\SourceContextProvider;
use Symfony\Component\VarDumper\Dumper\ContextualizedDumper;
/**
* @author Kévin Thérage <therage.kevin@gmail.com>
*/
class ContextualizedDumperTest extends TestCase
{ public function testContextualizedCliDumper() { $wrappedDumper =
new CliDumper('php://output'
);
$wrappedDumper->
setColors(true
);
$var = 'example';
$href =
sprintf('file://%s#L%s', __FILE__, 37
);
$dumper =
new ContextualizedDumper($wrappedDumper,
[new SourceContextProvider()]);
$cloner =
new VarCloner();
$data =
$cloner->
cloneVar($var);
ob_start();
$dumper->
dump($data);
$out =
ob_get_clean();