1
|
|
|
<?php |
2
|
|
|
/** |
3
|
|
|
* This file is part of phiremock-codeception-extension. |
4
|
|
|
* |
5
|
|
|
* phiremock-codeception-extension is free software: you can redistribute it and/or modify |
6
|
|
|
* it under the terms of the GNU Lesser General Public License as published by |
7
|
|
|
* the Free Software Foundation, either version 3 of the License, or |
8
|
|
|
* (at your option) any later version. |
9
|
|
|
* |
10
|
|
|
* phiremock-codeception-extension is distributed in the hope that it will be useful, |
11
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
12
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13
|
|
|
* GNU General Public License for more details. |
14
|
|
|
* |
15
|
|
|
* You should have received a copy of the GNU General Public License |
16
|
|
|
* along with phiremock-codeception-extension. If not, see <http://www.gnu.org/licenses/>. |
17
|
|
|
*/ |
18
|
|
|
|
19
|
|
|
namespace Codeception\Extension; |
20
|
|
|
|
21
|
|
|
use Codeception\Event\SuiteEvent; |
22
|
|
|
use Codeception\Exception\ConfigurationException; |
23
|
|
|
use Codeception\Extension as CodeceptionExtension; |
24
|
|
|
use Codeception\Suite; |
25
|
|
|
use Mcustiel\Phiremock\Codeception\Extension\Config; |
26
|
|
|
use Mcustiel\Phiremock\Codeception\Extension\PhiremockProcessManager; |
27
|
|
|
use Mcustiel\Phiremock\Codeception\Extension\ReadinessCheckerFactory; |
28
|
|
|
use Mcustiel\Phiremock\Codeception\Extension\Phiremock72; |
|
|
|
|
29
|
|
|
use Mcustiel\Phiremock\Codeception\Extension\Phiremock74p; |
|
|
|
|
30
|
|
|
|
31
|
|
|
class Phiremock extends CodeceptionExtension |
32
|
|
|
{ |
33
|
|
|
/** @var array */ |
34
|
|
|
public static $events = [ |
35
|
|
|
'suite.before' => 'startProcess', |
36
|
|
|
'suite.after' => 'stopProcess', |
37
|
|
|
]; |
38
|
|
|
|
39
|
|
|
/** Phiremock72|Phiremock74p */ |
40
|
|
|
private $instance; |
41
|
|
|
|
42
|
|
|
/** @throws ConfigurationException */ |
43
|
|
|
public function __construct( |
44
|
|
|
array $config, |
45
|
|
|
array $options, |
46
|
|
|
PhiremockProcessManager $process = null |
47
|
|
|
) { |
48
|
|
|
if (version_compare(PHP_VERSION, '7.4.0') >= 0) { |
49
|
|
|
$this->instance = new Phiremock74p($config, $options, $process); |
50
|
|
|
} else { |
51
|
|
|
$this->instance = new Phiremock72($config, $options, $process); |
52
|
|
|
} |
53
|
|
|
} |
54
|
|
|
|
55
|
|
|
public function startProcess(SuiteEvent $event): void |
56
|
|
|
{ |
57
|
|
|
$this->instance->startProcess($event); |
58
|
|
|
} |
59
|
|
|
|
60
|
|
|
public function stopProcess(): void |
61
|
|
|
{ |
62
|
|
|
$this->instance->stopProcess(); |
63
|
|
|
} |
64
|
|
|
} |
65
|
|
|
|
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