Skip to content

Commit

Permalink
Add SecretsManagerFactoryTest
Browse files Browse the repository at this point in the history
  • Loading branch information
MishNajam committed Oct 25, 2023
1 parent 8f2daa7 commit e0ce4ec
Showing 1 changed file with 34 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?php

declare(strict_types=1);

namespace AppTest\Service\Aws;

use App\Service\Aws\SecretsManagerFactory;
use Aws\Sdk;
use Aws\SecretsManager\SecretsManagerClient;
use Monolog\Test\TestCase;
use Prophecy\PhpUnit\ProphecyTrait;
use Psr\Container\ContainerInterface;

class SecretsManagerFactoryTest extends TestCase
{
use ProphecyTrait;

/** @test */
public function it_creates_a_SecretsManager() : void
{
$containerProphecy = $this->prophesize(ContainerInterface::class);

$containerProphecy->get(Sdk::class)
->willReturn(new Sdk([
'region' => 'eu-west-1',
'version' => 'latest',
]));

$factory = new SecretsManagerFactory();
$client = $factory($containerProphecy->reveal());

$this->assertInstanceOf(SecretsManagerClient::class, $client);
}
}

0 comments on commit e0ce4ec

Please sign in to comment.