Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
UnableToGenerateTemporaryUrl example
$this
->urlGenerator,
$this
->mediaService,
'php'
)
;
$this
->
expectException
(
\RuntimeException::
class
)
;
$downloadResponseGenerator
->
getResponse
(
$media
,
$this
->salesChannelContext
)
;
}
public
function
testThrowsExceptionWithoutDetachableResource
(
)
: void
{
$this
->privateFilesystem->
method
(
'temporaryUrl'
)
->
willThrowException
(
new
UnableToGenerateTemporaryUrl
(
'foo', 'baa'
)
)
;
$media
=
new
MediaEntity
(
)
;
$media
->
setId
(
Uuid::
randomHex
(
)
)
;
$media
->
setFileName
(
'foobar'
)
;
$media
->
setPrivate
(
true
)
;
$this
->
expectException
(
MediaException::
class
)
;
$this
->
expectExceptionMessage
(
'The file "foobar." does not exist'
)
;
$this
->downloadResponseGenerator->
getResponse
(
$media
,
$this
->salesChannelContext
)
;
}