1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace egabor\Composer\ReleasePlugin\Test; |
4
|
|
|
|
5
|
|
|
use PHPUnit\Framework\TestCase; |
|
|
|
|
6
|
|
|
|
7
|
|
|
abstract class ForwardCompatibleTestCase extends TestCase |
8
|
|
|
{ |
9
|
|
|
private $expectedException; |
10
|
|
|
private $expectedExceptionMessage = ''; |
11
|
|
|
private $expectedExceptionCode; |
12
|
|
|
|
13
|
|
|
public function expectException($exception) |
14
|
|
|
{ |
15
|
|
|
if (is_callable('parent::expectException')) { |
16
|
|
|
parent::expectException($exception); |
17
|
|
|
} else { |
18
|
|
|
$this->expectedException = $exception; |
19
|
|
|
$this->setExpectedException($exception, $this->expectedExceptionMessage, $this->expectedExceptionCode); |
20
|
|
|
} |
21
|
|
|
} |
22
|
|
|
|
23
|
|
|
public function expectExceptionMessage($message) |
24
|
|
|
{ |
25
|
|
|
if (is_callable('parent::expectExceptionMessage')) { |
26
|
|
|
parent::expectExceptionMessage($message); |
27
|
|
|
} else { |
28
|
|
|
$this->expectedExceptionMessage = $message; |
29
|
|
|
$this->setExpectedException($this->expectedException, $message, $this->expectedExceptionCode); |
30
|
|
|
} |
31
|
|
|
} |
32
|
|
|
|
33
|
|
|
public function expectExceptionCode($code) |
34
|
|
|
{ |
35
|
|
|
if (is_callable('parent::expectExceptionCode')) { |
36
|
|
|
parent::expectExceptionCode($code); |
37
|
|
|
} else { |
38
|
|
|
$this->expectedExceptionCode = $code; |
39
|
|
|
$this->setExpectedException($this->expectedException, $this->expectedExceptionMessage, $code); |
40
|
|
|
} |
41
|
|
|
} |
42
|
|
|
|
43
|
|
|
public function expectExceptionObject(\Exception $exception) |
44
|
|
|
{ |
45
|
|
|
if (is_callable('parent::expectExceptionObject')) { |
46
|
|
|
parent::expectExceptionObject($e); |
|
|
|
|
47
|
|
|
} else { |
48
|
|
|
$this->expectException(\get_class($exception)); |
49
|
|
|
$this->expectExceptionMessage($exception->getMessage()); |
50
|
|
|
$this->expectExceptionCode($exception->getCode()); |
51
|
|
|
} |
52
|
|
|
} |
53
|
|
|
|
54
|
|
|
protected function createMock($originalClassName) |
55
|
|
|
{ |
56
|
|
|
if (is_callable('parent::createMock')) { |
57
|
|
|
return parent::createMock($originalClassName); |
58
|
|
|
} |
59
|
|
|
|
60
|
|
|
return $this->getMockBuilder($originalClassName) |
61
|
|
|
->disableOriginalConstructor() |
62
|
|
|
->disableOriginalClone() |
63
|
|
|
->disableArgumentCloning() |
64
|
|
|
->getMock(); |
65
|
|
|
} |
66
|
|
|
} |
67
|
|
|
|
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"]
, you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths