StringQueryTest   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 testGetStringValue() 0 4 1
A testGetType() 0 4 1
1
<?php
2
3
namespace WikidataQueryApi\Query;
4
5
use DataValues\StringValue;
6
use Wikibase\DataModel\Entity\PropertyId;
7
8
/**
9
 * @covers WikidataQueryApi\Query\StringQuery
10
 *
11
 * @licence GPLv2+
12
 * @author Thomas Pellissier Tanon
13
 */
14
class StringQueryTest extends \PHPUnit_Framework_TestCase {
15
16
	public function testGetPropertyId() {
17
		$query = new StringQuery( new PropertyId( 'P42' ), new StringValue( 'foo' ) );
18
		$this->assertEquals( new PropertyId( 'P42' ), $query->getPropertyId() );
19
	}
20
21
	public function testGetStringValue() {
22
		$query = new StringQuery( new PropertyId( 'P42' ), new StringValue( 'foo' ) );
23
		$this->assertEquals( new StringValue( 'foo' ), $query->getStringValue() );
24
	}
25
26
	public function testGetType() {
27
		$query = new StringQuery( new PropertyId( 'P42' ), new StringValue( 'foo' ) );
28
		$this->assertEquals( 'string', $query->getType() );
29
	}
30
}
31