LastNodeSimplifierTest   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 44
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 8

Importance

Changes 2
Bugs 1 Features 0
Metric Value
wmc 4
c 2
b 1
f 0
lcom 0
cbo 8
dl 0
loc 44
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A buildSimplifier() 0 3 1
A simplifiableProvider() 0 7 1
A nonSimplifiableProvider() 0 7 1
A simplificationProvider() 0 21 1
1
<?php
2
3
namespace PPP\Module\TreeSimplifier;
4
5
use PPP\DataModel\IntersectionNode;
6
use PPP\DataModel\LastNode;
7
use PPP\DataModel\MissingNode;
8
use PPP\DataModel\ResourceListNode;
9
use PPP\DataModel\StringResourceNode;
10
11
/**
12
 * @covers PPP\Module\TreeSimplifier\LastNodeSimplifier
13
 *
14
 * @licence MIT
15
 * @author Thomas Pellissier Tanon
16
 */
17
class LastNodeSimplifierTest extends NodeSimplifierBaseTest {
18
19
	protected function buildSimplifier() {
20
		return new LastNodeSimplifier(new NodeSimplifierFactory());
21
	}
22
23
	public function simplifiableProvider() {
24
		return array(
25
			array(
26
				new LastNode(new ResourceListNode(array()))
27
			)
28
		);
29
	}
30
31
	public function nonSimplifiableProvider() {
32
		return array(
33
			array(
34
				new IntersectionNode(array())
35
			)
36
		);
37
	}
38
39
	public function simplificationProvider() {
40
		return array(
41
			array(
42
				new ResourceListNode(array(
43
					new StringResourceNode('bar')
44
				)),
45
				new LastNode(new ResourceListNode(array(
46
					new StringResourceNode('foo'),
47
					new StringResourceNode('bar')
48
				)))
49
			),
50
			array(
51
				new ResourceListNode(array()),
52
				new LastNode(new ResourceListNode(array()))
53
			),
54
			array(
55
				new LastNode(new MissingNode()),
56
				new LastNode(new MissingNode())
57
			),
58
		);
59
	}
60
}
61