UnionNodeNodeDeserializerTest   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 63
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 5

Importance

Changes 0
Metric Value
wmc 4
lcom 0
cbo 5
dl 0
loc 63
c 0
b 0
f 0
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A buildDeserializer() 0 3 1
A deserializableProvider() 0 10 1
A nonDeserializableProvider() 0 19 1
A deserializationProvider() 0 13 1
1
<?php
2
3
namespace PPP\DataModel\Deserializers;
4
5
use PPP\DataModel\DeserializerFactory;
6
use PPP\DataModel\MissingNode;
7
use PPP\DataModel\UnionNode;
8
9
/**
10
 * @covers PPP\DataModel\Deserializers\UnionNodeDeserializer
11
 *
12
 * @licence AGPLv3+
13
 * @author Thomas Pellissier Tanon
14
 */
15
class UnionNodeNodeDeserializerTest extends DeserializerBaseTest {
16
17
	/**
18
	 * @see DeserializerBaseTest::buildDeserializer
19
	 */
20
	public function buildDeserializer() {
21
		return new UnionNodeDeserializer(new DeserializerFactory());
22
	}
23
24
	/**
25
	 * @see DeserializerBaseTest::deserializableProvider
26
	 */
27
	public function deserializableProvider() {
28
		return array(
29
			array(
30
				array(
31
					'type' => 'union',
32
					'list' => array()
33
				),
34
			)
35
		);
36
	}
37
38
	/**
39
	 * @see DeserializerBaseTest::nonDeserializableProvider
40
	 */
41
	public function nonDeserializableProvider() {
42
		return array(
43
			array(
44
				42
45
			),
46
			array(
47
				array(
48
					'type' => 'true'
49
				)
50
			),
51
			array(
52
				array(
53
					'type' => 'true',
54
					'value-type' => 'boolean',
55
					'value' => 'true'
56
				)
57
			)
58
		);
59
	}
60
61
	/**
62
	 * @see DeserializerBaseTest::deserializationProvider
63
	 */
64
	public function deserializationProvider() {
65
		return array(
66
			array(
67
				new UnionNode(array(new MissingNode())),
68
				array(
69
					'type' => 'union',
70
					'list' => array(
71
						array('type' => 'missing')
72
					)
73
				)
74
			),
75
		);
76
	}
77
}
78