Passed
Push — master ( 63bd60...b32dd7 )
by Johnny
02:10
created

Test::score()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

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
ccs 0
cts 0
cp 0
crap 2
rs 10
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 14
     * Instance that keeps track of the score
29
     * for this test.
30 14
     *
31 14
     * @var Score
32
     */
33
    public ?Score $score = null;
34
    
35
    /**
36
     * Test constructor.
37
     *
38
     * Please not tests cant overwrite the function.
39
     */
40
    final function __construct()
41
    {
42
        $this->score = new Score($this);
43
    }
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