$compilers,
fn () =>
$this->assetMapper,
);
$pathResolver =
$this->
createMock(PublicAssetsPathResolverInterface::
class);
$pathResolver->
expects($this->
any()) ->
method('resolvePublicPath'
) ->
willReturnCallback(function Dstring
$logicalPath) { return '/final-assets/'.
$logicalPath;
});
$factory =
new MappedAssetFactory( $pathResolver,
$compiler );
// mock the AssetMapper to behave like normal: by calling back to the factory
$this->assetMapper =
$this->
createMock(AssetMapperInterface::
class);
$this->assetMapper->
expects($this->
any()) ->
method('getAsset'
) ->
willReturnCallback(function Dstring
$logicalPath) use ($factory) { $sourcePath = __DIR__.'/../fixtures/dir1/'.
$logicalPath;
if (!
is_file($sourcePath)) {