Skip to content

Commit fd89b76

Browse files
minor symfony#59480 [Notifier] Avoid failing SNS test with local AWS configuration (mRoca)
This PR was merged into the 6.4 branch. Discussion ---------- [Notifier] Avoid failing SNS test with local AWS configuration | Q | A | ------------- | --- | Branch? |6.4 | Bug fix? | yes | New feature? | no <!-- please update src/**/CHANGELOG.md files --> | Deprecations? |no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files --> | Issues | | License | MIT Currently, because of [AsyncAws way to get config options](https://github.com/async-aws/core/blob/master/src/EnvVar.php), Notifier tests cannot pass if you have any `AWS_***` default variables in your environment, or if you have a `~/.aws/config` file with the following content: ``` [default] region=eu-west-1 ``` Setting `AWS_PROFILE` env value allows bypassing default values, and overriding `AWS_REGION` value will allow tests without specified regions to pass. Commits ------- bb9adef tests(notifier): avoid failing SNS test with local AWS configuration
2 parents 827a2b5 + bb9adef commit fd89b76

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/Symfony/Component/Notifier/Bridge/AmazonSns/Tests/AmazonSnsTransportFactoryTest.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,12 @@ class AmazonSnsTransportFactoryTest extends TransportFactoryTestCase
1818
{
1919
public function createFactory(): AmazonSnsTransportFactory
2020
{
21+
// Tests will fail if a ~/.aws/config file exists with a default.region value,
22+
// or if AWS_REGION env variable is set.
23+
// Setting a profile & region names will bypass default options retrieved by \AsyncAws\Core::get
24+
$_ENV['AWS_PROFILE'] = 'not-existing';
25+
$_ENV['AWS_REGION'] = 'us-east-1';
26+
2127
return new AmazonSnsTransportFactory();
2228
}
2329

0 commit comments

Comments
 (0)