Suite::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 5
ccs 4
cts 4
cp 1
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 3
crap 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace ParaTest\Runners\PHPUnit;
6
7
/**
8
 * Class Suite.
9
 *
10
 * A suite represents an entire PHPUnit Test Suite
11
 * object - this class is essentially used for running
12
 * entire test classes in parallel
13
 */
14
class Suite extends ExecutableTest
15
{
16
    /**
17
     * A collection of test methods.
18
     *
19
     * @var array
20
     */
21
    private $functions;
22
23 57
    public function __construct(string $path, array $functions, string $fullyQualifiedClassName = null)
24
    {
25 57
        parent::__construct($path, $fullyQualifiedClassName);
26 57
        $this->functions = $functions;
27 57
    }
28
29
    /**
30
     * Return the collection of test methods.
31
     *
32
     * @return array
33
     */
34 4
    public function getFunctions(): array
35
    {
36 4
        return $this->functions;
37
    }
38
39
    /**
40
     * Get the expected count of tests to be executed.
41
     *
42
     * @return int
43
     */
44 15
    public function getTestCount(): int
45
    {
46 15
        return count($this->functions);
47
    }
48
}
49