ModuleResponseSerializerTest   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A testSerialize() 0 17 1
1
<?php
2
3
namespace PPP\Module\DataModel\Serializers;
4
5
use PPP\DataModel\MissingNode;
6
use PPP\DataModel\Serializers\MissingNodeSerializer;
7
use PPP\Module\DataModel\ModuleResponse;
8
9
/**
10
 * @covers PPP\Module\DataModel\Serializers\ModuleResponseSerializer
11
 *
12
 * @licence MIT
13
 * @author Thomas Pellissier Tanon
14
 */
15
class ModuleResponseSerializerTest extends \PHPUnit_Framework_TestCase {
16
17
	public function testSerialize() {
18
		$serializer = new ModuleResponseSerializer(new MissingNodeSerializer());
19
		$this->assertEquals(
20
			array(
21
				'language' => 'en',
22
				'tree' => array('type' => 'missing'),
23
				'measures' => (object) array('accuracy' => 1),
24
				'trace' => array('a')
25
			),
26
			$serializer->serialize(new ModuleResponse(
27
				'en',
28
				new MissingNode(),
29
				array('accuracy' => 1),
30
				array('a')
31
			))
32
		);
33
	}
34
}
35