Returns the web accessible URI pointing to the specified persistent resource
public getPublicPersistentResourceUri ( |
||
$resource | PersistentResource object | |
return | string | The URI |
/** * @test */ public function getPublicPersistentResourceUriFallsBackToConfiguredHttpBaseUri() { $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); $this->inject($this->fileSystemTarget, 'httpBaseUri', 'http://configured/http/base/uri/'); /** @var PersistentResource|\PHPUnit_Framework_MockObject_MockObject $mockResource */ $mockResource = $this->getMockBuilder(PersistentResource::class)->disableOriginalConstructor()->getMock(); $this->assertStringStartsWith('http://configured/http/base/uri/', $this->fileSystemTarget->getPublicPersistentResourceUri($mockResource)); }