ChainUserChecker example

$checker2 = $this->createMock(UserCheckerInterface::class);
        $checker2->expects($this->once())
            ->method('checkPreAuth')
            ->with($user);

        $checker3 = $this->createMock(UserCheckerInterface::class);
        $checker3->expects($this->once())
            ->method('checkPreAuth')
            ->with($user);

        (new ChainUserChecker([$checker1$checker2$checker3]))->checkPreAuth($user);
    }

    public function testForwardsPostAuthToAllUserCheckers()
    {
        $user = $this->createMock(UserInterface::class);

        $checker1 = $this->createMock(UserCheckerInterface::class);
        $checker1->expects($this->once())
            ->method('checkPostAuth')
            ->with($user);

        
Home | Imprint | This part of the site doesn't use cookies.