AbstractAssertion::setWebDriver()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 1
1
<?php
2
3
namespace Magium\Assertions;
4
5
use Magium\AbstractTestCase;
6
use Magium\InvalidTestTypeException;
7
use Magium\TestCaseAware;
8
use Magium\Util\Log\LoggerAware;
9
use Magium\Util\Log\LoggerInterface;
10
use Magium\WebDriver\WebDriver;
11
use Magium\WebDriver\WebDriverAware;
12
use PHPUnit\Framework\TestCase;
13
14
abstract class AbstractAssertion implements LoggerAware, TestCaseAware, WebDriverAware, AssertionInterface
15
{
16
    /**
17
     * @var LoggerInterface
18
     */
19
20
    protected $logger;
21
22
    /**
23
     * @var \PHPUnit_Framework_TestCase
24
     */
25
26
    protected $testCase;
27
28
    /**
29
     * @var WebDriver
30
     */
31
32
    protected $webDriver;
33
34
    public function setWebDriver(WebDriver $webdriver)
35
    {
36
        $this->webDriver = $webdriver;
37
    }
38
39
    public function setLogger(LoggerInterface $logger)
40
    {
41
        $this->logger = $logger;
42
    }
43
44
    public function setTestCase(TestCase $testCase)
45
    {
46
        $this->testCase = $testCase;
0 ignored issues
show
Documentation Bug introduced by
It seems like $testCase of type object<PHPUnit\Framework\TestCase> is incompatible with the declared type object<PHPUnit_Framework_TestCase> of property $testCase.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
47
    }
48
49
    /**
50
     * @return AbstractTestCase|\PHPUnit_Framework_TestCase
51
     * @throws InvalidTestTypeException
52
     */
53
54
    protected function getTestCase()
55
    {
56
        if (!$this->testCase instanceof AbstractTestCase) {
57
            throw new InvalidTestTypeException('Magium only understands instances of Magium\AbstractTestCase');
58
        }
59
        return $this->testCase;
60
    }
61
62
}
63