testArgumentsInterpretForPassedInAMQPTable()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 3
nc 1
nop 0
dl 0
loc 6
rs 10
c 1
b 0
f 0
1
<?php
2
3
namespace Tests\NeedleProject\LaravelRabbitMq\Interpreter;
4
5
use NeedleProject\LaravelRabbitMq\Interpreter\EntityArgumentsInterpreter;
6
use PhpAmqpLib\Wire\AMQPTable;
7
use PHPUnit\Framework\TestCase;
8
9
class EntityArgumentsInterpreterTest extends TestCase
10
{
11
    public function testArgumentsInterpret()
12
    {
13
        $interpretedArguments = EntityArgumentsInterpreter::interpretArguments(['x-queue-type' => 'quorum']);
14
        $this->assertInstanceOf(AMQPTable::class, $interpretedArguments);
15
        $this->assertEquals(
16
            ['x-queue-type' => [14 /* represent longstring*/, 'quorum']],
17
            [$interpretedArguments->key() => $interpretedArguments->current()]
18
        );
19
    }
20
21
    public function testArgumentsInterpretForPassedInAMQPTable()
22
    {
23
        $inputAmqpTable = new AMQPTable(['x-queue-type' => 'quorum']);
24
        $interpretedArguments = EntityArgumentsInterpreter::interpretArguments($inputAmqpTable);
25
26
        $this->assertEquals($interpretedArguments, $inputAmqpTable);
27
    }
28
}
29