Completed
Push — master ( 0e338e...cdc67b )
by Alessandro
09:41 queued 04:45
created

FullTestResult::__construct()   A

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