Skip to content

Commit 6bba5ab

Browse files
committed
Fixed tests.
1 parent e11fa57 commit 6bba5ab

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/CloudFrontUrlSignerServiceProvider.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,15 @@ public function register()
3535
{
3636
$this->mergeConfigFrom(__DIR__ . '/../config/cloudfront-url-signer.php', 'cloudfront-url-signer');
3737

38-
$config = config('cloudfront-url-signer');
38+
$this->app->singleton(UrlSigner::class, function () {
39+
$config = config('cloudfront-url-signer');
3940

40-
$this->app->singleton(UrlSigner::class, function () use ($config) {
4141
$cloudFrontClient = new CloudFrontClient([
4242
'region' => $config['region'],
4343
'version' => $config['version']
4444
]);;
4545

46-
return new CloudFrontUrlSigner($cloudFrontClient, $config['key_pair_id'], $config['private_key_path']);
46+
return new CloudFrontUrlSigner($cloudFrontClient, $config['private_key_path'], $config['key_pair_id']);
4747
});
4848

4949
$this->app->alias(UrlSigner::class, 'cloudfront-url-signer');

tests/SignatureGenerationTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ protected function setUp()
2525
/** @test */
2626
public function it_registered_cloudfront_url_signer_in_the_container()
2727
{
28-
config(['cloudfront-url-signer.private_key_path' => $this->dummyPrivateKeyPath]);
28+
config(['cloudfront-url-signer.key_pair_id' => $this->dummyKeyPairId]);
2929
$instance = $this->app['cloudfront-url-signer'];
3030

3131
$this->assertInstanceOf(\Dreamonkey\CloudFrontUrlSigner\CloudFrontUrlSigner::class, $instance);

0 commit comments

Comments
 (0)