File tree 3 files changed +25
-1
lines changed
3 files changed +25
-1
lines changed Original file line number Diff line number Diff line change 1
1
<?php
2
2
3
+ use Aws \Laravel \AwsServiceProvider ;
4
+ use Illuminate \Foundation \Application ;
5
+
3
6
return [
4
7
5
8
/*
20
23
],
21
24
'region ' => env ('AWS_REGION ' , 'us-east-1 ' ),
22
25
'version ' => 'latest ' ,
23
-
26
+ 'ua_append ' => [
27
+ 'Laravel/ ' . Application::VERSION ,
28
+ 'L5MOD/ ' . AwsServiceProvider::VERSION ,
29
+ ],
24
30
];
Original file line number Diff line number Diff line change 8
8
*/
9
9
class AwsServiceProvider extends ServiceProvider
10
10
{
11
+ const VERSION = '3.0.1 ' ;
11
12
12
13
/**
13
14
* Indicates if loading of the provider is deferred.
Original file line number Diff line number Diff line change @@ -46,6 +46,23 @@ public function testServiceNameIsProvided()
46
46
$ this ->assertContains ('aws ' , $ provider ->provides ());
47
47
}
48
48
49
+ public function testVersionInformationIsProvidedToSdkUserAgent ()
50
+ {
51
+ $ app = $ this ->setupApplication ();
52
+ $ this ->setupServiceProvider ($ app );
53
+ $ config = $ app ['config ' ]->get ('aws ' );
54
+
55
+ $ this ->assertArrayHasKey ('ua_append ' , $ config );
56
+ $ this ->assertInternalType ('array ' , $ config ['ua_append ' ]);
57
+ $ this ->assertNotEmpty ($ config ['ua_append ' ]);
58
+ $ this ->assertNotEmpty (array_filter ($ config ['ua_append ' ], function ($ ua ) {
59
+ return false !== strpos ($ ua , Application::VERSION );
60
+ }));
61
+ $ this ->assertNotEmpty (array_filter ($ config ['ua_append ' ], function ($ ua ) {
62
+ return false !== strpos ($ ua , AwsServiceProvider::VERSION );
63
+ }));
64
+ }
65
+
49
66
/**
50
67
* @return Application
51
68
*/
You can’t perform that action at this time.
0 commit comments