Passed
Push — master ( 892005...6afd92 )
by Alexander
07:55
created

JsonSerializerTest::unserializeProvider()   A

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
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 6
rs 10
1
<?php
2
3
namespace Yiisoft\Serializer\Tests;
4
5
use Yiisoft\Serializer\JsonSerializer;
6
use Yiisoft\Serializer\SerializerInterface;
7
8
class JsonSerializerTest extends SerializerTest
9
{
10
    public function getSerializer(): SerializerInterface
11
    {
12
        return new JsonSerializer();
13
    }
14
15
    public function serializeProvider(): array
16
    {
17
        return $this->dataProvider();
18
    }
19
20
    public function unserializeProvider(): array
21
    {
22
        $data = $this->dataProvider();
23
        $data['object'] = [[], '{}',];
24
25
        return $data;
26
    }
27
28
    public function dataProvider(): array
29
    {
30
        return [
31
            'int' => [1, '1',],
32
            'float' => [1.1, '1.1',],
33
            'string' => ['a', '"a"',],
34
            'null' => [null, 'null',],
35
            'bool' => [true, 'true',],
36
            'object' => [new \stdClass(), '{}',],
37
            'array' => [[], '[]',],
38
        ];
39
    }
40
}
41