コード例 #1
0
 /**
  * Create service
  *
  * @param ServiceLocatorInterface $serviceLocator
  * @return mixed
  */
 public function createService(ServiceLocatorInterface $serviceLocator)
 {
     $topLevelIdentityProvider = new ChainedIdentityProvider();
     $identityProviderServices = ['Aeris\\ZfAuth\\IdentityProvider\\OAuthUserIdentityProvider', 'Aeris\\ZfAuth\\IdentityProvider\\OAuthClientIdentityProvider', 'Aeris\\ZfAuth\\IdentityProvider\\AnonymousIdentityProvider'];
     $providers = array_map([$serviceLocator, 'get'], $identityProviderServices);
     $topLevelIdentityProvider->setProviders($providers);
     return $topLevelIdentityProvider;
 }
コード例 #2
0
 /** @test */
 public function getIdentity_shouldReturnNullWhenNoProviders()
 {
     $provider = new ChainedIdentityProvider([]);
     $this->assertEquals(null, $provider->getIdentity());
 }