ClaimQueryTest   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A testGetPropertyId() 0 4 1
A testGetItemId() 0 4 1
A testGetType() 0 4 1
1
<?php
2
3
namespace WikidataQueryApi\Query;
4
5
use Wikibase\DataModel\Entity\ItemId;
6
use Wikibase\DataModel\Entity\PropertyId;
7
8
/**
9
 * @covers WikidataQueryApi\Query\ClaimQuery
10
 *
11
 * @licence GPLv2+
12
 * @author Thomas Pellissier Tanon
13
 */
14
class ClaimQueryTest extends \PHPUnit_Framework_TestCase {
15
16
	public function testGetPropertyId() {
17
		$query = new ClaimQuery( new PropertyId( 'P42' ), new ItemId( 'Q42' ) );
18
		$this->assertEquals( new PropertyId( 'P42' ), $query->getPropertyId() );
19
	}
20
21
	public function testGetItemId() {
22
		$query = new ClaimQuery( new PropertyId( 'P42' ), new ItemId( 'Q42' ) );
23
		$this->assertEquals( new ItemId( 'Q42' ), $query->getItemId() );
24
	}
25
26
	public function testGetType() {
27
		$query = new ClaimQuery( new PropertyId( 'P42' ) );
28
		$this->assertEquals( 'claim', $query->getType() );
29
	}
30
}
31