Skip to content

Commit

Permalink
snsqs tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ASKozienko committed Feb 19, 2019
1 parent 514e324 commit 0568fa5
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
7 changes: 7 additions & 0 deletions SnsClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,13 @@ public function createTopic(array $args): Result
return $this->callApi('createTopic', $args);
}

public function deleteTopic(string $topicArn): Result
{
return $this->callApi('DeleteTopic', [
'TopicArn' => $topicArn,
]);
}

public function publish(array $args): Result
{
return $this->callApi('publish', $args);
Expand Down
7 changes: 7 additions & 0 deletions SnsContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,13 @@ public function declareTopic(SnsDestination $destination): void
$this->topicArns[$destination->getTopicName()] = (string) $result->get('TopicArn');
}

public function deleteTopic(SnsDestination $destination): void
{
$this->client->deleteTopic($this->getTopicArn($destination));

unset($this->topicArns[$destination->getTopicName()]);
}

public function subscribe(SnsSubscribe $subscribe): void
{
foreach ($this->getSubscriptions($subscribe->getTopic()) as $subscription) {
Expand Down

0 comments on commit 0568fa5

Please sign in to comment.