Skip to content

Commit 0568fa5

Browse files
committed
snsqs tests
1 parent 514e324 commit 0568fa5

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

SnsClient.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,13 @@ public function createTopic(array $args): Result
3838
return $this->callApi('createTopic', $args);
3939
}
4040

41+
public function deleteTopic(string $topicArn): Result
42+
{
43+
return $this->callApi('DeleteTopic', [
44+
'TopicArn' => $topicArn,
45+
]);
46+
}
47+
4148
public function publish(array $args): Result
4249
{
4350
return $this->callApi('publish', $args);

SnsContext.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,13 @@ public function declareTopic(SnsDestination $destination): void
7777
$this->topicArns[$destination->getTopicName()] = (string) $result->get('TopicArn');
7878
}
7979

80+
public function deleteTopic(SnsDestination $destination): void
81+
{
82+
$this->client->deleteTopic($this->getTopicArn($destination));
83+
84+
unset($this->topicArns[$destination->getTopicName()]);
85+
}
86+
8087
public function subscribe(SnsSubscribe $subscribe): void
8188
{
8289
foreach ($this->getSubscriptions($subscribe->getTopic()) as $subscription) {

0 commit comments

Comments
 (0)