LastNodeSimplifierTest::nonSimplifiableProvider()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

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