Completed
Push — master ( a5dbc2...034320 )
by Tim
01:30
created

TestCaseFactory::getTestSuite()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 0
dl 0
loc 5
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
namespace SimpleSAML\Module\monitor;
4
5
abstract class TestCaseFactory extends TestFactory
6
{
7
    private $testsuite = null;
8
    private $category = null;
9
    private $subject = null;
10
11
    public function __construct($testsuite, $input)
12
    {
13
        assert($testsuite instanceof TestSuite);
14
        assert(is_array($input));
15
        $this->setTestSuite($testsuite);
16
        $this->setInput($input);
17
        $this->initialize();
18
        $this->setInput(null);
19
        $this->invokeTest();
20
    }
21
22
    /*
23
     * @return void
24
     */
25
    protected function initialize()
26
    {
27
    }
28
29
    /*
30
     * @return void
31
     */
32
    private function setTestSuite($testsuite)
33
    {
34
        assert($testsuite instanceof TestSuite);
35
        $this->testsuite = $testsuite;
36
    }
37
38
39
    /*
40
     * @return TestSuite
41
     */
42
    public function getTestSuite()
43
    {
44
        assert($this->testsuite instanceof TestSuite);
45
        return $this->testsuite;
46
    }
47
48
49
    /*
50
     * @return void
51
     */
52
    protected function setSubject($subject)
53
    {
54
        assert(is_string($subject));
55
        $this->subject = $subject;
56
    }
57
58
59
    /*
60
     * @return string
61
     */
62
    public function getSubject()
63
    {
64
        assert(is_string($this->subject));
65
        return $this->subject;
66
    }
67
68
69
    /*
70
     * @return void
71
     */
72
    protected function setCategory($category)
73
    {
74
        assert(is_string($category));
75
        $this->category = $category;
76
    }
77
78
79
    /*
80
     * @return string
81
     */
82
    public function getCategory()
83
    {
84
        assert(is_string($this->category));
85
        return $this->category;
86
    }
87
88
    
89
    /*
90
     * @return void
91
     */
92
    abstract protected function invokeTest();
93
}
94