public function injectAuthenticationManagerSetsAReferenceToTheSecurityContextInTheAuthenticationManager() { $securityContext = $this->getAccessibleMock(Context::class, ['initialize']); $mockAuthenticationManager = $this->createMock(AuthenticationManagerInterface::class); $mockAuthenticationManager->expects($this->once())->method('setSecurityContext')->with($securityContext); $securityContext->injectAuthenticationManager($mockAuthenticationManager); }