AroundQuerySerializerTest   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 5

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 4
c 2
b 0
f 0
lcom 0
cbo 5
dl 0
loc 37
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A buildSerializer() 0 3 1
A serializableProvider() 0 7 1
A nonSerializableProvider() 0 13 1
A serializationProvider() 0 8 1
1
<?php
2
3
namespace WikidataQueryApi\Query\Serializers;
4
5
use DataValues\LatLongValue;
6
use Wikibase\DataModel\Entity\PropertyId;
7
use WikidataQueryApi\Query\AroundQuery;
8
9
/**
10
 * @covers WikidataQueryApi\Query\Serializers\AroundQuerySerializer
11
 *
12
 * @licence GPLv2+
13
 * @author Thomas Pellissier Tanon
14
 */
15
class AroundQuerySerializerTest extends SerializerBaseTest {
16
17
	public function buildSerializer() {
18
		return new AroundQuerySerializer();
19
	}
20
21
	public function serializableProvider() {
22
		return [
23
			[
24
				new AroundQuery( new PropertyId( 'P42' ), new LatLongValue( 42, 42 ), 1 )
25
			],
26
		];
27
	}
28
29
	public function nonSerializableProvider() {
30
		return [
31
			[
32
				5
33
			],
34
			[
35
				[]
36
			],
37
			[
38
				new LatLongValue( 42, 42 )
39
			],
40
		];
41
	}
42
43
	public function serializationProvider() {
44
		return [
45
			[
46
				'around[42,42,42,1]',
47
				new AroundQuery( new PropertyId( 'P42' ), new LatLongValue( 42, 42 ), 1 )
48
			],
49
		];
50
	}
51
}
52