Skip to content

Commit

Permalink
Adds an alias to every client service
Browse files Browse the repository at this point in the history
  • Loading branch information
MolloKhan committed Sep 26, 2017
1 parent 28edfb5 commit 6924de0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/DependencyInjection/KnpUOAuth2ClientExtension.php
Expand Up @@ -214,6 +214,8 @@ private function configureProviderAndClient(ContainerBuilder $container, $provid
$clientDefinition->addMethodCall('setAsStateless');
}

$container->setAlias($clientClass, $clientServiceKey);

return $clientServiceKey;
}

Expand Down
6 changes: 6 additions & 0 deletions tests/DependencyInjection/KnpUOAuth2ClientExtensionTest.php
Expand Up @@ -80,6 +80,12 @@ public function testFacebookProviderMakesService()
],
$clientDefinition->getArguments()
);

// the client service has an alias
$this->assertTrue(
$this->configuration->hasAlias('KnpU\OAuth2ClientBundle\Client\Provider\FacebookClient'),
'FacebookClient service is missing an alias'
);
}

/**
Expand Down

0 comments on commit 6924de0

Please sign in to comment.