/**
* @dataProvider provideCustomEscaperCases
*
* @param string|int|null $string
*
* @runInSeparateProcess
* custom escaper are cached inside twig, therefore this test has to run in seperate processes, where the custom escapers are not yet cached
*/
public function testCustomEscaper(string
$expected,
$string, string
$strategy): void
{ $twig =
new Environment($this->
createMock(LoaderInterface::
class));
$twig->
getExtension(EscaperExtension::
class)->
setEscaper('foo', 'Shopware\Tests\Unit\Core\Framework\Adapter\Twig\foo_escaper_for_test'
);
static::
assertSame($expected,
sw_escape_filter($twig,
$string,
$strategy));
} /**
* @return array<int, array<int, int|string|null>>
*/
public static function provideCustomEscaperCases(): array
{ return [ ['fooUTF-8', 'foo', 'foo'
],
[