Completed
Pull Request — master (#37)
by Alessandro
02:23
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
use Paraunit\TestResult\Interfaces\FailureMessageInterface;
5
use Paraunit\TestResult\Interfaces\FunctionNameInterface;
6
use Paraunit\TestResult\Interfaces\PrintableTestResultInterface;
7
use Paraunit\TestResult\Interfaces\StackTraceInterface;
8
9
/**
10
 * Class FullTestResult
11
 * @package Paraunit\TestResult
12
 */
13
class FullTestResult extends TestResultWithMessage implements PrintableTestResultInterface, FunctionNameInterface, FailureMessageInterface, StackTraceInterface
14
{
15
    /** @var TraceStep[] */
16
    private $trace;
17
18
    /**
19
     * FullTestResult constructor.
20
     * @param TestResultFormat $testResultFormat
21
     * @param string $functionName
22
     * @param string $failureMessage
23
     */
24 23
    public function __construct($testResultFormat, $functionName, $failureMessage)
25
    {
26 23
        parent::__construct($testResultFormat, $functionName, $failureMessage);
27 23
        $this->trace = array();
28 23
    }
29
30
    /**
31
     * @return TraceStep[]
32
     */
33 7
    public function getTrace()
34
    {
35 7
        return $this->trace;
36
    }
37
38
    /**
39
     * @param TraceStep $traceStep
40
     */
41 10
    public function addTraceStep(TraceStep $traceStep)
42
    {
43 10
        $this->trace[] = $traceStep;
44 10
    }
45
}
46