AroundQueryTest   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

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

4 Methods

Rating   Name   Duplication   Size   Complexity  
A testGetPropertyId() 0 4 1
A testGetLatLongValue() 0 4 1
A testRadius() 0 4 1
A testGetType() 0 4 1
1
<?php
2
3
namespace WikidataQueryApi\Query;
4
5
use DataValues\LatLongValue;
6
use Wikibase\DataModel\Entity\PropertyId;
7
8
/**
9
 * @covers WikidataQueryApi\Query\AroundQuery
10
 *
11
 * @licence GPLv2+
12
 * @author Thomas Pellissier Tanon
13
 */
14
class AroundQueryTest extends \PHPUnit_Framework_TestCase {
15
16
	public function testGetPropertyId() {
17
		$query = new AroundQuery( new PropertyId( 'P42' ), new LatLongValue( 42, 42 ), 1 );
18
		$this->assertEquals( new PropertyId( 'P42' ), $query->getPropertyId() );
19
	}
20
21
	public function testGetLatLongValue() {
22
		$query = new AroundQuery( new PropertyId( 'P42' ), new LatLongValue( 42, 42 ), 1 );
23
		$this->assertEquals( new LatLongValue( 42, 42 ), $query->getLatLongValue() );
24
	}
25
26
	public function testRadius() {
27
		$query = new AroundQuery( new PropertyId( 'P42' ), new LatLongValue( 42, 42 ), 1 );
28
		$this->assertEquals( 1, $query->getRadius() );
29
	}
30
31
	public function testGetType() {
32
		$query = new AroundQuery( new PropertyId( 'P42' ), new LatLongValue( 42, 42 ), 1 );
33
		$this->assertEquals( 'around', $query->getType() );
34
	}
35
}
36