getMockBuilder('Symfony\Component\Routing\Generator\UrlGenerator') ->disableOriginalConstructor() ->getMock(); $session = $this->getMock('Symfony\Component\HttpFoundation\Session\SessionInterface'); $userManipulator = $this->getMockBuilder(UserManipulator::class) ->disableOriginalConstructor() ->getMock(); $userRepository = $this->getMockBuilder(UserRepository::class) ->disableOriginalConstructor() ->getMock(); $ACLProvider = $this->getMockBuilder(ACLProvider::class) ->disableOriginalConstructor() ->getMock(); $appbox = $this->getMockBuilder(appbox::class) ->disableOriginalConstructor() ->getMock(); $randomGenerator = $this->getMockBuilder(RandomGenerator::class) ->disableOriginalConstructor() ->getMock(); $usrAuthProviderRepository = $this->getMockBuilder(UsrAuthProviderRepository::class) ->disableOriginalConstructor() ->getMock(); $entityManager = $this->getMockBuilder(EntityManager::class) ->disableOriginalConstructor() ->getMock(); $factory = new Factory($generator, $session, $userManipulator, $userRepository, $ACLProvider, $appbox, $randomGenerator, $usrAuthProviderRepository, $entityManager ); $this->assertInstanceOf($expected, $factory->build($id, $type, true, $id, $options)); } public function provideNameAndOptions() { return [ [ 'github-foo', 'github', [ 'client-id' => 'id', 'client-secret' => 'secret' ], 'Alchemy\Phrasea\Authentication\Provider\Github' ], [ 'linkedin-foo', 'linkedin', [ 'client-id' => 'id', 'client-secret' => 'secret' ], 'Alchemy\Phrasea\Authentication\Provider\Linkedin' ], [ 'twitter-foo', 'twitter', [ 'consumer-key' => 'id', 'consumer-secret' => 'secret' ], 'Alchemy\Phrasea\Authentication\Provider\Twitter' ], [ 'viadeo-foo', 'viadeo', [ 'client-id' => 'id', 'client-secret' => 'secret' ], 'Alchemy\Phrasea\Authentication\Provider\Viadeo' ], [ 'ps-auth-foo', 'ps-auth', [ 'client-id' => 'id', 'client-secret' => 'secret', 'base-url' => 'https://api-auth.phrasea.local', 'provider-type' => 'oauth', 'provider-name' => 'v2', ], 'Alchemy\Phrasea\Authentication\Provider\PsAuth' ] ]; } }