Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
chalasr committed Feb 18, 2019
1 parent 43300af commit d05b54d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 5 additions & 1 deletion DependencyInjection/LexikJWTAuthenticationExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,11 @@ public function load(array $configs, ContainerBuilder $container)
}

if (empty($config['public_key']) && empty($config['secret_key'])) {
throw new InvalidConfigurationException('You must either configure a "public_key" or a "secret_key".', 'lexik_jwt_authentication');
$e = new InvalidConfigurationException('You must either configure a "public_key" or a "secret_key".');
$e->setPath('lexik_jwt_authentication');

throw $e;

}

$container->setParameter('lexik_jwt_authentication.pass_phrase', $config['pass_phrase']);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public function testDeprecatedDefaultEncoderService()
public function testTokenExtractorsConfiguration()
{
// Default configuration
$chainTokenExtractor = $this->getContainer()->getDefinition('lexik_jwt_authentication.extractor.chain_extractor');
$chainTokenExtractor = $this->getContainer(['secret_key' => 'private.pem', 'public_key' => 'public.pem'])->getDefinition('lexik_jwt_authentication.extractor.chain_extractor');

$extractorIds = array_map('strval', $chainTokenExtractor->getArgument(0));

Expand All @@ -83,7 +83,7 @@ public function testTokenExtractorsConfiguration()
$this->assertNotContains('lexik_jwt_authentication.extractor.query_parameter_extractor', $extractorIds);

// Custom configuration
$chainTokenExtractor = $this->getContainer(['token_extractors' => ['authorization_header' => true, 'cookie' => true]])
$chainTokenExtractor = $this->getContainer(['secret_key' => 'private.pem', 'public_key' => 'public.pem', 'token_extractors' => ['authorization_header' => true, 'cookie' => true]])
->getDefinition('lexik_jwt_authentication.extractor.chain_extractor');

$extractorIds = array_map('strval', $chainTokenExtractor->getArgument(0));
Expand Down

0 comments on commit d05b54d

Please sign in to comment.