Completed
Push — master ( a7a349...3fc402 )
by Guillermo A.
03:23
created

PutItemOperationTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
eloc 9
c 1
b 0
f 0
dl 0
loc 15
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A testToArray() 0 13 1
1
<?php
2
3
namespace GuillermoandraeTest\DynamoDb\Operation;
4
5
use Guillermoandrae\DynamoDb\Factory\DynamoDbClientFactory;
6
use Guillermoandrae\DynamoDb\Factory\MarshalerFactory;
7
use Guillermoandrae\DynamoDb\Operation\PutItemOperation;
8
use PHPUnit\Framework\TestCase;
9
10
final class PutItemOperationTest extends TestCase
11
{
12
    public function testToArray()
13
    {
14
        $data = ['black' => 'man'];
15
        $request = new PutItemOperation(DynamoDbClientFactory::factory(), MarshalerFactory::factory(), 'test', $data);
16
        $expectedItem = [
17
            'TableName' => 'test',
18
            'Item' => [
19
                'black' => [
20
                    'S' => $data['black']
21
                ]
22
            ]
23
        ];
24
        $this->assertSame($expectedItem, $request->toArray());
25
    }
26
}
27