class_exists(CoreExtension::
class); // Load twig_convert_encoding()
class_exists(EscaperExtension::
class); // Load twig_escape_filter()
$twigEnvironment =
$this->
mockTwigEnvironment();
$varCloner =
new VarCloner();
$webProfilerExtension =
new WebProfilerExtension();
$needle = 'window.Sfdump';
$dump1 =
$webProfilerExtension->
dumpLog($twigEnvironment,
$message,
$varCloner->
cloneVar($context));
self::
assertSame($dump1HasHeader,
str_contains($dump1,
$needle));
$dump2 =
$webProfilerExtension->
dumpData($twigEnvironment,
$varCloner->
cloneVar([]));
self::
assertSame($dump2HasHeader,
str_contains($dump2,
$needle));
} public static function provideMessages(): iterable
{ yield ['Some message',
['foo' => 'foo', 'bar' => 'bar'
], false, true
];
yield ['Some message {@see some text}',
['foo' => 'foo', 'bar' => 'bar'
], false, true
];
yield ['Some message {foo}',
['foo' => 'foo', 'bar' => 'bar'
], true, false
];