InMemoryUserChecker example

use PHPUnit\Framework\TestCase;
use Symfony\Component\Security\Core\Exception\DisabledException;
use Symfony\Component\Security\Core\User\InMemoryUser;
use Symfony\Component\Security\Core\User\InMemoryUserChecker;
use Symfony\Component\Security\Core\User\UserInterface;

class InMemoryUserCheckerTest extends TestCase
{
    public function testCheckPostAuthNotAdvancedUserInterface()
    {
        $checker = new InMemoryUserChecker();

        $this->assertNull($checker->checkPostAuth($this->createMock(UserInterface::class)));
    }

    public function testCheckPostAuthPass()
    {
        $checker = new InMemoryUserChecker();
        $this->assertNull($checker->checkPostAuth(new InMemoryUser('John', 'password')));
    }

    public function testCheckPreAuthDisabled()
    {
Home | Imprint | This part of the site doesn't use cookies.