SentenceNodeTest   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 5
lcom 0
cbo 2
dl 0
loc 37
c 0
b 0
f 0
rs 10

5 Methods

Rating   Name   Duplication   Size   Complexity  
A testGetValue() 0 4 1
A testGetType() 0 4 1
A testEquals() 0 4 1
A testNonEquals() 0 3 1
A nonEqualsProvider() 0 12 1
1
<?php
2
3
namespace PPP\DataModel;
4
5
/**
6
 * @covers PPP\DataModel\SentenceNode
7
 *
8
 * @licence AGPLv3+
9
 * @author Thomas Pellissier Tanon
10
 */
11
class SentenceNodeTest extends \PHPUnit_Framework_TestCase {
12
13
	public function testGetValue() {
14
		$node = new SentenceNode('foo');
15
		$this->assertEquals('foo', $node->getValue());
16
	}
17
18
	public function testGetType() {
19
		$node = new SentenceNode('foo');
20
		$this->assertEquals('sentence', $node->getType());
21
	}
22
23
	public function testEquals() {
24
		$node = new SentenceNode('a');
25
		$this->assertTrue($node->equals(new SentenceNode('a')));
26
	}
27
28
	/**
29
	 * @dataProvider nonEqualsProvider
30
	 */
31
	public function testNonEquals(SentenceNode $node, $target) {
32
		$this->assertFalse($node->equals($target));
33
	}
34
35
	public function nonEqualsProvider() {
36
		return array(
37
			array(
38
				new SentenceNode('a'),
39
				new MissingNode()
40
			),
41
			array(
42
				new SentenceNode('a'),
43
				new SentenceNode('b')
44
			),
45
		);
46
	}
47
}
48