Completed
Push — master ( 298f36...c6c82d )
by Mihail
06:19 queued 10s
created

PhpSerializerTest   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 10
c 1
b 0
f 0
dl 0
loc 29
rs 10
wmc 4
1
<?php
2
3
namespace Koded\Stdlib\Serializer;
4
5
use Koded\Stdlib\Interfaces\Serializer;
6
use PHPUnit\Framework\TestCase;
7
8
class PhpSerializerTest extends TestCase
9
{
10
11
    /** @var PhpSerializer */
12
    private $SUT;
13
14
    private $original;
15
    private $serialized;
16
17
    public function test_serialize()
18
    {
19
        $this->assertEquals($this->serialized, $this->SUT->serialize($this->original));
20
    }
21
22
    public function test_unserialize()
23
    {
24
        $this->assertEquals($this->original, $this->SUT->unserialize($this->serialized));
25
    }
26
27
    public function testName()
28
    {
29
        $this->assertSame(Serializer::PHP, $this->SUT->type());
30
    }
31
32
    protected function setUp(): void
33
    {
34
        $this->SUT = new PhpSerializer;
35
        $this->original = require __DIR__ . '/../fixtures/config-test.php';
36
        $this->serialized = serialize($this->original);
37
    }
38
}
39