ModuleRequestSerializerTest   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Importance

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

1 Method

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