public function beginAuthentication_trustedOptionUsedOnlyIfContextAllows() { $request = $this->getRequest(); $user = $this->getUser(); $context = $this->getAuthenticationContext(); $context->expects($this->once())->method('useTrustedOption')->willReturn(false); $this->cookieManager->expects($this->never())->method('isTrustedComputer')->with($request, $user); $this->authHandler->expects($this->once())->method('beginAuthentication'); $this->trustedFilter->beginAuthentication($context); }