File: CreateQueueRequestTest.php

package info (click to toggle)
php-async-aws-sqs 2.7.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 664 kB
  • sloc: php: 4,040; makefile: 31
file content (37 lines) | stat: -rw-r--r-- 1,048 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<?php

namespace AsyncAws\Sqs\Tests\Unit\Input;

use AsyncAws\Core\Test\TestCase;
use AsyncAws\Sqs\Input\CreateQueueRequest;

class CreateQueueRequestTest extends TestCase
{
    public function testRequest(): void
    {
        $input = new CreateQueueRequest([
            'QueueName' => 'MyQueue',
            'Attributes' => ['DelaySeconds' => '45'],
            'tags' => ['team' => 'Engineering'],
        ]);

        /** @see https://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_CreateQueue.html */
        $expected = '
            POST / HTTP/1.0
            Content-Type: application/x-amz-json-1.0
            x-amz-target: AmazonSQS.CreateQueue
            Accept: application/json

            {
                "QueueName":"MyQueue",
                "Attributes": {
                    "DelaySeconds": "45"
                },
                "tags": {
                    "team": "Engineering"
                }
            }';

        self::assertRequestEqualsHttpRequest($expected, $input->request());
    }
}