Completed
Pull Request — master (#37)
by Alessandro
06:14
created

TestResultWithMessage::getFunctionName()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 0
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
9
/**
10
 * Class TestResultWithMessage
11
 * @package Paraunit\TestResult
12
 */
13
class TestResultWithMessage extends MuteTestResult implements PrintableTestResultInterface, FunctionNameInterface, FailureMessageInterface
14
{
15
    /** @var  string */
16
    private $functionName;
17
18
    /** @var  string */
19
    private $failureMessage;
20
21
    /**
22
     * TestResultWithMessage constructor.
23
     * @param TestResultFormat $testResultFormat
24
     * @param string $functionName
25
     * @param string $failureMessage
26
     */
27 30
    public function __construct(TestResultFormat $testResultFormat, $functionName, $failureMessage)
28
    {
29 30
        $this->setTestResultFormat($testResultFormat);
30 30
        $this->functionName = $functionName;
31 30
        $this->failureMessage = $failureMessage;
32 30
    }
33
34
    /**
35
     * @return string
36
     */
37 10
    public function getFunctionName()
38
    {
39 10
        return $this->functionName;
40
    }
41
42
    /**
43
     * @return string
44
     */
45 11
    public function getFailureMessage()
46
    {
47 11
        return $this->failureMessage;
48
    }
49
}
50