public function testGetAssetFromFilesystemPath() { $assetMapper =
$this->
createAssetMapper();
$this->mappedAssetFactory->
expects($this->
once()) ->
method('createMappedAsset'
) ->
with('file1.css',
realpath(__DIR__.'/fixtures/dir1/file1.css'
)) ->
willReturn(new MappedAsset('file1.css'
));
$asset =
$assetMapper->
getAssetFromSourcePath(__DIR__.'/fixtures/dir1/file1.css'
);
$this->
assertSame('file1.css',
$asset->logicalPath
);
} private function createAssetMapper(): AssetMapper
{ $dirs =
['dir1' => '', 'dir2' => '', 'dir3' => ''
];
$repository =
new AssetMapperRepository($dirs, __DIR__.'/fixtures'
);
$pathResolver =
$this->
createMock(PublicAssetsPathResolverInterface::
class);
$pathResolver->
expects($this->
any()) ->
method('getPublicFilesystemPath'
) ->
willReturn(__DIR__.'/fixtures/test_public/final-assets'
);