1010
1111namespace SebastianBergmann \CodeCoverage ;
1212
13+ use SebastianBergmann \CodeCoverage \Driver \PHPDBG ;
1314use SebastianBergmann \CodeCoverage \Driver \Xdebug ;
1415
1516/**
@@ -27,8 +28,12 @@ protected function setUp()
2728 $ this ->coverage = new CodeCoverage ;
2829 }
2930
30- public function testCanBeConstructedWithoutGivenFilterObject ()
31+ public function testCanBeConstructedForXdebugWithoutGivenFilterObject ()
3132 {
33+ if (PHP_SAPI == 'phpdbg ' ) {
34+ $ this ->markTestSkipped ('Requires PHP CLI and Xdebug ' );
35+ }
36+
3237 $ this ->assertAttributeInstanceOf (
3338 Xdebug::class,
3439 'driver ' ,
@@ -42,8 +47,12 @@ public function testCanBeConstructedWithoutGivenFilterObject()
4247 );
4348 }
4449
45- public function testCanBeConstructedWithGivenFilterObject ()
50+ public function testCanBeConstructedForXdebugWithGivenFilterObject ()
4651 {
52+ if (PHP_SAPI == 'phpdbg ' ) {
53+ $ this ->markTestSkipped ('Requires PHP CLI and Xdebug ' );
54+ }
55+
4756 $ filter = new Filter ;
4857 $ coverage = new CodeCoverage (null , $ filter );
4958
@@ -56,6 +65,43 @@ public function testCanBeConstructedWithGivenFilterObject()
5665 $ this ->assertSame ($ filter , $ coverage ->filter ());
5766 }
5867
68+ public function testCanBeConstructedForPhpdbgWithoutGivenFilterObject ()
69+ {
70+ if (PHP_SAPI != 'phpdbg ' ) {
71+ $ this ->markTestSkipped ('Requires PHPDBG ' );
72+ }
73+
74+ $ this ->assertAttributeInstanceOf (
75+ PHPDBG ::class,
76+ 'driver ' ,
77+ $ this ->coverage
78+ );
79+
80+ $ this ->assertAttributeInstanceOf (
81+ Filter::class,
82+ 'filter ' ,
83+ $ this ->coverage
84+ );
85+ }
86+
87+ public function testCanBeConstructedForPhpdbgWithGivenFilterObject ()
88+ {
89+ if (PHP_SAPI != 'phpdbg ' ) {
90+ $ this ->markTestSkipped ('Requires PHPDBG ' );
91+ }
92+
93+ $ filter = new Filter ;
94+ $ coverage = new CodeCoverage (null , $ filter );
95+
96+ $ this ->assertAttributeInstanceOf (
97+ PHPDBG ::class,
98+ 'driver ' ,
99+ $ coverage
100+ );
101+
102+ $ this ->assertSame ($ filter , $ coverage ->filter ());
103+ }
104+
59105 /**
60106 * @expectedException SebastianBergmann\CodeCoverage\Exception
61107 */
0 commit comments