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

TestCaseFactory   A

Complexity

Total Complexity 8

Size/Duplication

Total Lines 89
Duplicated Lines 0 %

Coupling/Cohesion

Components 3
Dependencies 1

Importance

Changes 0
Metric Value
dl 0
loc 89
rs 10
c 0
b 0
f 0
wmc 8
lcom 3
cbo 1

9 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 10 1
A initialize() 0 3 1
A setTestSuite() 0 5 1
A getTestSuite() 0 5 1
A setSubject() 0 5 1
A getSubject() 0 5 1
A setCategory() 0 5 1
A getCategory() 0 5 1
invokeTest() 0 1 ?
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