Passed
Push — master ( 1b6475...610123 )
by Petr
10:18
created

JsonTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 10
dl 0
loc 17
rs 10
c 0
b 0
f 0
wmc 1
1
<?php
2
3
namespace InfoFormatTests;
4
5
6
use kalanis\UploadPerPartes\Exceptions\UploadException;
7
use kalanis\UploadPerPartes\InfoFormat;
8
9
10
class JsonTest extends AFormats
11
{
12
    /**
13
     * @throws UploadException
14
     */
15
    public function testThru(): void
16
    {
17
        $lib = new InfoFormat\Json();
18
        $target = $lib->toFormat($this->mockData());
19
        $data = $lib->fromFormat($target);
20
21
        $this->assertEquals('abcdef', $data->fileName);
22
        $this->assertEquals($this->getTestDir() . 'abcdef', $data->tempLocation);
23
        $this->assertEquals(123456, $data->fileSize);
24
        $this->assertEquals(12, $data->partsCount);
25
        $this->assertEquals(64, $data->bytesPerPart);
26
        $this->assertEquals(7, $data->lastKnownPart);
27
    }
28
}
29