Completed
Push — master ( 5ba1dc...b85ec4 )
by Tomasz
02:09
created

FormatTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 2
c 1
b 0
f 1
lcom 0
cbo 3
dl 0
loc 16
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testArrayUnserializeInvalidTypeException() 0 6 1
A testMissingUnserializationHandlerException() 0 6 1
1
<?php
2
namespace Thunder\Serializard\Tests;
3
4
use Thunder\Serializard\Format\ArrayFormat;
5
use Thunder\Serializard\HydratorContainer\HydratorContainer;
6
use Thunder\Serializard\NormalizerContainer\NormalizerContainer;
7
8
/**
9
 * @author Tomasz Kowalczyk <[email protected]>
10
 */
11
class FormatTest extends \PHPUnit_Framework_TestCase
12
{
13
    public function testArrayUnserializeInvalidTypeException()
14
    {
15
        $format = new ArrayFormat();
16
        $this->setExpectedException('RuntimeException');
0 ignored issues
show
Deprecated Code introduced by
The method PHPUnit_Framework_TestCase::setExpectedException() has been deprecated with message: Method deprecated since Release 5.2.0

This method has been deprecated. The supplier of the class has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the method will be removed from the class and what other method or class to use instead.

Loading history...
17
        $format->unserialize(new \stdClass(), 'stdClass', new HydratorContainer());
18
    }
19
20
    public function testMissingUnserializationHandlerException()
21
    {
22
        $format = new ArrayFormat();
23
        $this->setExpectedException('RuntimeException');
0 ignored issues
show
Deprecated Code introduced by
The method PHPUnit_Framework_TestCase::setExpectedException() has been deprecated with message: Method deprecated since Release 5.2.0

This method has been deprecated. The supplier of the class has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the method will be removed from the class and what other method or class to use instead.

Loading history...
24
        $format->unserialize(array(), 'stdClass', new HydratorContainer());
25
    }
26
}
27