Passed
Push — master ( 345c9b...faecaf )
by Michiel
20:58
created

testIfReferenceSetThenCreateIncludeThrowsException()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 4
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 6
rs 10
1
<?php
2
class PatternSetTest extends \PHPUnit\Framework\TestCase
3
{
4
    private $patternset;
5
6
    protected function setUp(): void
7
    {
8
        $this->patternset = new PatternSet();
9
    }
10
11
    public function testBothEmpty()
12
    {
13
        $s = "" . $this->patternset;
14
        $this->assertEquals($s, "patternSet{ includes: empty  excludes: empty }");
15
        $this->assertEquals(false, $this->patternset->hasPatterns());
16
    }
17
18
    /**
19
     * @expectedException BuildException
20
     * @expectedExceptionMessage You must not specify nested elements when using refid
21
     */
22
    public function testIfReferenceSetThenCreateIncludeThrowsException()
23
    {
24
        $project = new Project();
25
        $reference = new Reference($project);
26
        $this->patternset->setRefId($reference);
27
        $this->patternset->createInclude();
28
    }
29
30
    /**
31
     * @expectedException BuildException
32
     * @expectedExceptionMessage You must not specify nested elements when using refid
33
     */
34
    public function testIfReferenceSetThenCreateExcludeThrowsException()
35
    {
36
        $project = new Project();
37
        $reference = new Reference($project);
38
        $this->patternset->setRefId($reference);
39
        $this->patternset->createExclude();
40
    }
41
42
    /**
43
     * @expectedException BuildException
44
     * @expectedExceptionMessage You must not specify nested elements when using refid
45
     */
46
    public function testIfReferencesSetThenCreatExcludesFileThrowsException()
47
    {
48
        $project = new Project();
49
        $reference = new Reference($project);
50
        $this->patternset->setRefId($reference);
51
        $this->patternset->createExcludesFile();
52
    }
53
54
    /**
55
     * @expectedException BuildException
56
     * @expectedExceptionMessage You must not specify nested elements when using refid
57
     */
58
    public function testIfReferencesSetThenCreatIncludesFileThrowsException()
59
    {
60
        $project = new Project();
61
        $reference = new Reference($project);
62
        $this->patternset->setRefId($reference);
63
        $this->patternset->createIncludesFile();
64
    }
65
66
}
67