Neos\Flow\ResourceManagement\Target\FileSystemTarget::getPublicStaticResourceUri PHP Method

getPublicStaticResourceUri() public method

Returns the web accessible URI pointing to the given static resource
public getPublicStaticResourceUri ( string $relativePathAndFilename ) : string
$relativePathAndFilename string Relative path and filename of the static resource
return string The URI
    public function getPublicStaticResourceUri($relativePathAndFilename)
    {
        return $this->getResourcesBaseUri() . $this->encodeRelativePathAndFilenameForUri($relativePathAndFilename);
    }

Usage Example

 /**
  * @test
  * @expectedException \Neos\Flow\ResourceManagement\Target\Exception
  */
 public function getPublicPersistentResourceUriThrowsExceptionIfBaseUriCantBeResolved()
 {
     $mockBootstrap = $this->getMockBuilder(Bootstrap::class)->disableOriginalConstructor()->getMock();
     $mockCommandRequestHandler = $this->getMockBuilder(CommandRequestHandler::class)->disableOriginalConstructor()->getMock();
     $mockBootstrap->expects($this->any())->method('getActiveRequestHandler')->will($this->returnValue($mockCommandRequestHandler));
     $this->inject($this->fileSystemTarget, 'bootstrap', $mockBootstrap);
     /** @var PersistentResource|\PHPUnit_Framework_MockObject_MockObject $mockResource */
     $mockResource = $this->getMockBuilder(PersistentResource::class)->disableOriginalConstructor()->getMock();
     $this->fileSystemTarget->getPublicStaticResourceUri($mockResource);
 }