Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
createEntryPoint example
/** * @dataProvider getAuthenticationExceptionProvider */
public
function
testAuthenticationExceptionWithEntryPoint
(
\Exception
$exception
)
{
$event
=
$this
->
createEvent
(
$exception
)
;
$response
=
new
Response
(
'Forbidden', 403
)
;
$listener
=
$this
->
createExceptionListener
(
null, null, null,
$this
->
createEntryPoint
(
$response
)
)
;
$listener
->
onKernelException
(
$event
)
;
$this
->
assertTrue
(
$event
->
isAllowingCustomResponseCode
(
)
)
;
$this
->
assertEquals
(
'Forbidden',
$event
->
getResponse
(
)
->
getContent
(
)
)
;
$this
->
assertEquals
(
403,
$event
->
getResponse
(
)
->
getStatusCode
(
)
)
;
$this
->
assertSame
(
$exception
,
$event
->
getThrowable
(
)
)
;
}
public
static
function
getAuthenticationExceptionProvider
(
)
{