Skip to content

Commit 3f98927

Browse files
authored
Merge pull request #111 from rycius100/fix/awsProvider-topicExists
Fix for topicExists function
2 parents 907ce98 + 1994a8e commit 3f98927

3 files changed

Lines changed: 4 additions & 7 deletions

File tree

src/Provider/AwsProvider.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
namespace Uecode\Bundle\QPushBundle\Provider;
2424

25-
use Aws\Sns\Exception\NotFoundException;
25+
use Aws\Sns\Exception\SnsException;
2626
use Aws\Sns\SnsClient;
2727
use Aws\Sqs\Exception\SqsException;
2828
use Aws\Sqs\SqsClient;
@@ -427,7 +427,7 @@ public function topicExists()
427427
$this->sns->getTopicAttributes([
428428
'TopicArn' => $topicArn
429429
]);
430-
} catch (NotFoundException $e) {
430+
} catch (SnsException $e) {
431431
return false;
432432
}
433433

tests/Message/NotificationTest.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,6 @@ public function tearDown()
3939
$this->message = null;
4040
}
4141

42-
/**
43-
* @expectedException PHPUnit_Framework_Error
44-
*/
4542
public function testConstructor()
4643
{
4744
$notification = new Notification(123, ['foo' => 'bar'], ['baz' => 'qux']);

tests/MockClient/SnsMockClient.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
namespace Uecode\Bundle\QPushBundle\Tests\MockClient;
2424

25-
use Aws\Sns\Exception\NotFoundException;
25+
use Aws\Sns\Exception\SnsException;
2626
use Doctrine\Common\Collections\ArrayCollection;
2727

2828
/**
@@ -54,7 +54,7 @@ public function createTopic(array $args)
5454
public function getTopicAttributes(array $args)
5555
{
5656
if ($args['TopicArn'] == null) {
57-
throw new NotFoundException;
57+
throw new SnsException;
5858
}
5959

6060
return new ArrayCollection([

0 commit comments

Comments
 (0)