Test Failed
Pull Request — master (#22)
by mon
02:08
created

bcSetExpectedException()   A

Complexity

Conditions 3
Paths 4

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 3
eloc 5
nc 4
nop 3
dl 0
loc 8
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace FileEye\MimeMap\Test;
4
5
// PHPUnit compatibility trait for PHPUnit 7.
6
trait Phpunit7CompatibilityTrait
7
{
8
    public function setUp()
9
    {
10
        parent::setUp();
11
        if (method_exists($this, 'fcSetUp')) {
12
            $this->fcSetUp();
13
        }
14
    }
15
16
    public function tearDown()
17
    {
18
        if (method_exists($this, 'fcTearDown')) {
19
            $this->fcTearDown();
20
        }
21
        parent::tearDown();
22
    }
23
24
    public function bcSetExpectedException($exceptionName, $exceptionMessage = '', $exceptionCode = null)
25
    {
26
        parent::expectException($exceptionName);
27
        if ($exceptionMessage) {
28
            parent::expectExceptionMessage($exceptionMessage);
29
        }
30
        if ($exceptionCode !== null) {
31
            parent::expectExceptionCode($exceptionCode);
32
        }
33
    }
34
}
35