AroundQueryTest::testGetLatLongValue()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

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