Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
MyOwnChildException example
$envelope
=
new
Envelope
(
new
\
stdClass
(
)
)
;
$exception
=
new
MyOwnException
(
)
;
$handlerException
=
new
HandlerFailedException
(
$envelope
,
[
new
\
LogicException
(
)
,
$exception
]
)
;
$this
->
assertSame
(
[
$exception
]
,
$handlerException
->
getNestedExceptionOfClass
(
MyOwnException::
class
)
)
;
}
public
function
testThatNestedExceptionClassAreFoundWhenUsingChildException
(
)
{
$envelope
=
new
Envelope
(
new
\
stdClass
(
)
)
;
$exception
=
new
MyOwnChildException
(
)
;
$handlerException
=
new
HandlerFailedException
(
$envelope
,
[
$exception
]
)
;
$this
->
assertSame
(
[
$exception
]
,
$handlerException
->
getNestedExceptionOfClass
(
MyOwnException::
class
)
)
;
}
public
function
testThatNestedExceptionClassAreNotFoundIfNotPresent
(
)
{
$envelope
=
new
Envelope
(
new
\
stdClass
(
)
)
;
$exception
=
new
\
LogicException
(
)
;
$handlerException
=
new
HandlerFailedException
(
$envelope
,
[
$exception
]
)
;