-
-
Notifications
You must be signed in to change notification settings - Fork 367
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1690 from vmiguellima/add-get-queue-name-to-sqs-r…
…ecord Add ability to get queue name from sqs event
- Loading branch information
Showing
2 changed files
with
29 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?php declare(strict_types=1); | ||
|
||
namespace Bref\Test\Event\Sqs; | ||
|
||
use Bref\Event\Sqs\SqsRecord; | ||
use PHPUnit\Framework\TestCase; | ||
|
||
class SqsRecordTest extends TestCase | ||
{ | ||
public function test_it_can_get_queue_name_from_sqs_event() | ||
{ | ||
$event = json_decode(file_get_contents(__DIR__ . '/sqs.json'), true); | ||
|
||
$sqsRecord = new SqsRecord($event['Records'][0]); | ||
|
||
$this->assertSame($sqsRecord->getQueueName(), 'my-queue'); | ||
} | ||
} |