public function supports(MappedAsset
$asset): bool
{ return 'js' ===
$asset->publicExtension;
} public function compile(string
$content, MappedAsset
$asset, AssetMapperInterface
$assetMapper): string
{ return $content.' compiler3 called';
} };
$compiler =
new AssetMapperCompiler( [$compiler1,
$compiler2,
$compiler3],
fn () =>
$this->
createMock(AssetMapperInterface::
class),
);
$asset =
new MappedAsset('foo.js', publicPathWithoutDigest: '/assets/foo.js'
);
$actualContents =
$compiler->
compile('starting contents',
$asset,
$this->
createMock(AssetMapperInterface::
class));
$this->
assertSame('starting contents compiler2 called compiler3 called',
$actualContents);
}}