Passed
Push — master ( 8ba091...d47090 )
by Johnny
06:24
created

Test::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
ccs 2
cts 2
cp 1
crap 1
1
<?php
2
/**
3
 * Test.php
4
 *
5
 * The abstract class for Tests inside the TestSuite.
6
 *
7
 * PHP version 7.4
8
 *
9
 * @category Core
10
 * @package  RedboxTestSuite
11
 * @author   Johnny Mast <[email protected]>
12
 * @license  https://opensource.org/licenses/MIT MIT
13
 * @link     https://github.com/johnnymast/redbox-testsuite
14
 * @since    GIT:1.0
15
 */
16
17
namespace Redbox\Testsuite;
18
19
/**
20
 * Class Test
21
 *
22
 * @package Redbox\Testsuite
23
 */
24
abstract class Test
25
{
26
    
27
    /**
28
     * Instance that keeps track of the score
29
     * for this test.
30
     *
31
     * @var Score
32
     */
33
    public ?Score $score = null;
34
    
35
    /**
36
     * Test constructor.
37
     *
38
     * Please not tests cant overwrite the function.
39
     */
40 32
    final function __construct()
41
    {
42 32
        $this->score = new Score($this);
43 32
    }
44
    
45
    /**
46
     * Tests must implement this method to indicate
47
     * the minimum score this test can reach.
48
     *
49
     * @return mixed
50
     */
51
    abstract public function minScore();
52
    
53
    /**
54
     * Tests must implement this method to indicate
55
     * the maximum score this test can reach.
56
     *
57
     * @return mixed
58
     */
59
    abstract public function maxScore();
60
    
61
    /**
62
     * Tests must implement this method to start
63
     * running their tests.
64
     *
65
     * @return void
66
     */
67
    abstract public function run();
68
}
69