@@ -105,6 +105,34 @@ public function testNotRegisterSqs()
105105 self ::assertFalse ($ container ->has (SqsClient::class));
106106 }
107107
108+ public function testConfigOverride ()
109+ {
110+ $ kernel = $ this ->createKernel ();
111+ $ kernel ->addConfigFile (__DIR__ . '/Resources/config/override.yaml ' );
112+ $ this ->bootKernel ();
113+
114+ $ container = $ this ->getContainer ();
115+ self ::assertTrue ($ container ->has ('async_aws.client.s3 ' ));
116+ self ::assertTrue ($ container ->has ('async_aws.client.ses ' ));
117+ self ::assertTrue ($ container ->has ('async_aws.client.sqs ' ));
118+
119+ /** @var SesClient $ses */
120+ $ ses = $ container ->get ('async_aws.client.ses ' );
121+ self ::assertEquals ('eu-central-1 ' , $ ses ->getConfiguration ()->get ('region ' ));
122+
123+ /** @var S3Client $s3 */
124+ $ s3 = $ container ->get ('async_aws.client.s3 ' );
125+ self ::assertEquals ('us-west-1 ' , $ s3 ->getConfiguration ()->get ('region ' ));
126+ self ::assertEquals ('key ' , $ s3 ->getConfiguration ()->get ('accessKeyId ' ));
127+ self ::assertEquals ('secret ' , $ s3 ->getConfiguration ()->get ('accessKeySecret ' ));
128+
129+ /** @var SqsClient $sqs */
130+ $ sqs = $ container ->get ('async_aws.client.sqs ' );
131+ self ::assertEquals ('eu-central-1 ' , $ sqs ->getConfiguration ()->get ('region ' ));
132+ self ::assertFalse ($ sqs ->getConfiguration ()->has ('accessKeyId ' ));
133+ self ::assertFalse ($ sqs ->getConfiguration ()->has ('accessKeySecret ' ));
134+ }
135+
108136 public function testExceptionWhenConfigureServiceNotInstalled ()
109137 {
110138 if (class_exists (SnsClient::class)) {
0 commit comments