AroundQuerySerializerTest::serializableProvider()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
cc 1
eloc 3
c 2
b 0
f 0
nc 1
nop 0
dl 0
loc 7
rs 9.4285
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