Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
onError example
$this
->
createMock
(
EntityCacheKeyGenerator::
class
)
,
$this
->
createMock
(
CacheInvalidator::
class
)
,
new
EventDispatcher
(
)
)
;
$event
=
new
ExceptionEvent
(
$this
->
createMock
(
Kernel::
class
)
,
new
Request
(
)
,
0,
new
\
Exception
(
)
)
;
$subscriber
->
onError
(
$event
)
;
static
::
assertNull
(
$event
->
getResponse
(
)
)
;
}
public
function
testErrorHandled
(
)
: void
{
$controller
=
$this
->
createMock
(
ErrorController::
class
)
;
$controller
->
expects
(
static
::
once
(
)
)
->
method
(
'error'
)
->
willReturn
(
new
StorefrontResponse
(
)
)
;