Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
FakeCustomToken example
use
Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
use
Symfony\Component\Security\Core\User\InMemoryUser;
use
Symfony\Component\Security\Core\User\UserInterface;
class
AuthenticationTrustResolverTest
extends
TestCase
{
public
function
testIsRememberMe
(
)
{
$resolver
=
new
AuthenticationTrustResolver
(
)
;
$this
->
assertFalse
(
$resolver
->
isRememberMe
(
null
)
)
;
$this
->
assertFalse
(
$resolver
->
isRememberMe
(
new
FakeCustomToken
(
)
)
)
;
$this
->
assertTrue
(
$resolver
->
isRememberMe
(
new
RealCustomRememberMeToken
(
)
)
)
;
$this
->
assertTrue
(
$resolver
->
isRememberMe
(
$this
->
getRememberMeToken
(
)
)
)
;
}
public
function
testisFullFledged
(
)
{
$resolver
=
new
AuthenticationTrustResolver
(
)
;
$this
->
assertFalse
(
$resolver
->
isFullFledged
(
null
)
)
;
$this
->
assertFalse
(
$resolver
->
isFullFledged
(
$this
->
getRememberMeToken
(
)
)
)
;
$this
->
assertFalse
(
$resolver
->
isFullFledged
(
new
RealCustomRememberMeToken
(
)
)
)
;