Completed
Push — master ( 9a7b87...ad20a3 )
by Alessandro
03:07
created

FullTestResult::getTrace()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 4
cp 0
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
crap 2
1
<?php
2
declare(strict_types=1);
3
4
namespace Paraunit\TestResult;
5
6
use Paraunit\TestResult\Interfaces\FailureMessageInterface;
7
use Paraunit\TestResult\Interfaces\FunctionNameInterface;
8
use Paraunit\TestResult\Interfaces\PrintableTestResultInterface;
9
use Paraunit\TestResult\Interfaces\StackTraceInterface;
10
11
/**
12
 * Class FullTestResult
13
 * @package Paraunit\TestResult
14
 */
15
class FullTestResult extends TestResultWithMessage implements PrintableTestResultInterface, FunctionNameInterface, FailureMessageInterface, StackTraceInterface
16
{
17
    /** @var TraceStep[] */
18
    private $trace;
19
20
    /**
21
     * FullTestResult constructor.
22
     * @param string $functionName
23
     * @param string $failureMessage
24
     */
25
    public function __construct(string $functionName, string $failureMessage)
26
    {
27
        parent::__construct($functionName, $failureMessage);
28
        $this->trace = [];
29
    }
30
31
    /**
32
     * @return TraceStep[]
33
     */
34
    public function getTrace(): array
35
    {
36
        return $this->trace;
37
    }
38
39
    public function addTraceStep(TraceStep $traceStep)
40
    {
41
        $this->trace[] = $traceStep;
42
    }
43
}
44