|
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
|
69 |
|
public function expectException($exception) |
|
14
|
|
|
{ |
|
15
|
69 |
|
if (is_callable('parent::expectException')) { |
|
16
|
69 |
|
parent::expectException($exception); |
|
17
|
|
|
} else { |
|
18
|
|
|
$this->expectedException = $exception; |
|
19
|
|
|
$this->setExpectedException($exception, $this->expectedExceptionMessage, $this->expectedExceptionCode); |
|
20
|
|
|
} |
|
21
|
69 |
|
} |
|
22
|
|
|
|
|
23
|
52 |
|
public function expectExceptionMessage($message) |
|
24
|
|
|
{ |
|
25
|
52 |
|
if (is_callable('parent::expectExceptionMessage')) { |
|
26
|
52 |
|
parent::expectExceptionMessage($message); |
|
27
|
|
|
} else { |
|
28
|
|
|
$this->expectedExceptionMessage = $message; |
|
29
|
|
|
$this->setExpectedException($this->expectedException, $message, $this->expectedExceptionCode); |
|
30
|
|
|
} |
|
31
|
52 |
|
} |
|
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($exception); |
|
47
|
|
|
} else { |
|
48
|
|
|
$this->expectException(\get_class($exception)); |
|
49
|
|
|
$this->expectExceptionMessage($exception->getMessage()); |
|
50
|
|
|
$this->expectExceptionCode($exception->getCode()); |
|
51
|
|
|
} |
|
52
|
|
|
} |
|
53
|
|
|
|
|
54
|
1 |
|
protected function createMock($originalClassName) |
|
55
|
|
|
{ |
|
56
|
1 |
|
if (is_callable('parent::createMock')) { |
|
57
|
1 |
|
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