Completed
Push — master ( 2e5350...f0c5b4 )
by Tobias
10:07
created

ExcludeTest::testSerialize()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 7
Ratio 100 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 7
loc 7
rs 9.4285
cc 1
eloc 4
nc 1
nop 0
1
<?php
2
3
namespace Happyr\SerializerBundle\Tests\Functional;
4
5
use Happyr\SerializerBundle\Tests\Fixtures\Exclude\Car;
6
7
class ExcludeTest extends SerializerTestCase
8
{
9
    public function testSerialize()
10
    {
11
        $data = $this->serialize(new Car(true));
12
13
        $this->assertFalse(isset($data['model']));
14
        $this->assertTrue(isset($data['size']));
15
    }
16
17
    public function testDeserialize()
18
    {
19
        $data = ['model' => 'model_value', 'size' => 'size_value'];
20
        $obj = $this->deserialize($data, Car::class);
21
22
        $this->assertPropertyValue($obj, 'model', null);
23
        $this->assertPropertyValue($obj, 'size', 'size_value');
24
    }
25
}
26