File tree Expand file tree Collapse file tree 1 file changed +8
-10
lines changed Expand file tree Collapse file tree 1 file changed +8
-10
lines changed Original file line number Diff line number Diff line change 11
11
12
12
use const PHP_SAPI ;
13
13
use function extension_loaded ;
14
- use function ini_get ;
15
- use function xdebug_code_coverage_started ;
14
+ use function in_array ;
15
+ use function phpversion ;
16
+ use function version_compare ;
16
17
use function xdebug_get_code_coverage ;
18
+ use function xdebug_info ;
17
19
use SebastianBergmann \CodeCoverage \Filter ;
18
20
use SebastianBergmann \CodeCoverage \TestCase ;
19
21
@@ -25,16 +27,12 @@ protected function setUp(): void
25
27
$ this ->markTestSkipped ('This test requires the PHP commandline interpreter ' );
26
28
}
27
29
28
- if (!extension_loaded ('xdebug ' )) {
29
- $ this ->markTestSkipped ('This test requires the Xdebug extension to be loaded ' );
30
+ if (!extension_loaded ('xdebug ' ) || ! version_compare ( phpversion ( ' xdebug ' ), ' 3.1 ' , ' >= ' ) ) {
31
+ $ this ->markTestSkipped ('This test requires the Xdebug extension (version >= 3.1) to be loaded ' );
30
32
}
31
33
32
- if (!ini_get ('xdebug.mode ' ) || ini_get ('xdebug.mode ' ) !== 'coverage ' ) {
33
- $ this ->markTestSkipped ('This test requires the Xdebug extension \'s code coverage functionality to be enabled ' );
34
- }
35
-
36
- if (!xdebug_code_coverage_started ()) {
37
- $ this ->markTestSkipped ('This test requires code coverage data collection using Xdebug to be active ' );
34
+ if (!in_array ('coverage ' , xdebug_info ('mode ' ), true )) {
35
+ $ this ->markTestSkipped ('This test requires code coverage data collection using Xdebug to be enabled ' );
38
36
}
39
37
}
40
38
You can’t perform that action at this time.
0 commit comments