File tree Expand file tree Collapse file tree 3 files changed +23
-10
lines changed Expand file tree Collapse file tree 3 files changed +23
-10
lines changed Original file line number Diff line number Diff line change 13
13
use SebastianBergmann \CodeCoverage \DeadCodeDetectionNotSupportedException ;
14
14
use SebastianBergmann \CodeCoverage \Filter ;
15
15
use SebastianBergmann \CodeCoverage \TestCase ;
16
- use SebastianBergmann \Environment \Runtime ;
17
16
18
17
final class PcovDriverTest extends TestCase
19
18
{
20
19
protected function setUp (): void
21
20
{
22
- if (!(new Runtime )->hasPCOV ()) {
23
- $ this ->markTestSkipped ('This test is only applicable to PCOV ' );
21
+ if (\PHP_SAPI !== 'cli ' ) {
22
+ $ this ->markTestSkipped ('This test requires the PHP commandline interpreter ' );
23
+ }
24
+
25
+ if (!\extension_loaded ('pcov ' )) {
26
+ $ this ->markTestSkipped ('This test requires the PCOV extension to be loaded ' );
27
+ }
28
+
29
+ if (!\ini_get ('pcov.enabled ' )) {
30
+ $ this ->markTestSkipped ('This test requires the PCOV extension to be enabled ' );
24
31
}
25
32
}
26
33
Original file line number Diff line number Diff line change 12
12
use SebastianBergmann \CodeCoverage \BranchAndPathCoverageNotSupportedException ;
13
13
use SebastianBergmann \CodeCoverage \DeadCodeDetectionNotSupportedException ;
14
14
use SebastianBergmann \CodeCoverage \TestCase ;
15
- use SebastianBergmann \Environment \Runtime ;
16
15
17
16
final class PhpdbgDriverTest extends TestCase
18
17
{
19
18
protected function setUp (): void
20
19
{
21
- if (!( new Runtime )-> hasPHPDBGCodeCoverage () ) {
22
- $ this ->markTestSkipped ('This test is only applicable to PHPDBG ' );
20
+ if (\ PHP_SAPI !== ' phpdbg ' ) {
21
+ $ this ->markTestSkipped ('This test requires the PHPDBG commandline interpreter ' );
23
22
}
24
23
}
25
24
Original file line number Diff line number Diff line change 11
11
12
12
use SebastianBergmann \CodeCoverage \Filter ;
13
13
use SebastianBergmann \CodeCoverage \TestCase ;
14
- use SebastianBergmann \Environment \Runtime ;
15
14
16
15
final class XdebugDriverTest extends TestCase
17
16
{
18
17
protected function setUp (): void
19
18
{
20
- if (!(new Runtime )->hasXdebug ()) {
21
- $ this ->markTestSkipped ('This test is only applicable to Xdebug ' );
19
+ if (\PHP_SAPI !== 'cli ' ) {
20
+ $ this ->markTestSkipped ('This test requires the PHP commandline interpreter ' );
21
+ }
22
+
23
+ if (!\extension_loaded ('xdebug ' )) {
24
+ $ this ->markTestSkipped ('This test requires the Xdebug extension to be loaded ' );
25
+ }
26
+
27
+ if (!\ini_get ('xdebug.coverage_enable ' )) {
28
+ $ this ->markTestSkipped ('This test requires the Xdebug extension \'s code coverage functionality to be enabled ' );
22
29
}
23
30
24
31
if (!\xdebug_code_coverage_started ()) {
25
- $ this ->markTestSkipped ('This test requires code coverage using Xdebug to be running ' );
32
+ $ this ->markTestSkipped ('This test requires code coverage data collection using Xdebug to be active ' );
26
33
}
27
34
}
28
35
You can’t perform that action at this time.
0 commit comments