Skip to content

Commit cfa1bb9

Browse files
committed
Use PHPDBG tests for Windows (PHP7 / appveyor) / Xdebug for Linux (Travis CI)
1 parent 53496bf commit cfa1bb9

File tree

1 file changed

+52
-0
lines changed

1 file changed

+52
-0
lines changed

tests/Common/Driver/StubTest.php

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@
1818
*/
1919
class StubTest extends TestCase
2020
{
21+
/**
22+
* @requires OS Linux
23+
*/
2124
public function testGetterSetter()
2225
{
2326
$mock = $this->getMock('PHP_CodeCoverage_Driver_Xdebug');
@@ -29,6 +32,9 @@ public function testGetterSetter()
2932
$this->assertTrue($driver->getDriver() === $mock);
3033
}
3134

35+
/**
36+
* @requires OS Linux
37+
*/
3238
public function testStart()
3339
{
3440
$mock = $this->getMock('PHP_CodeCoverage_Driver_Xdebug');
@@ -40,6 +46,9 @@ public function testStart()
4046
$driver->start();
4147
}
4248

49+
/**
50+
* @requires OS Linux
51+
*/
4352
public function testStop()
4453
{
4554
$mock = $this->getMock('PHP_CodeCoverage_Driver_Xdebug');
@@ -50,4 +59,47 @@ public function testStop()
5059
$driver->setDriver($mock);
5160
$driver->stop();
5261
}
62+
63+
/**
64+
* @requires OS WIN
65+
*/
66+
public function testGetterSetter()
67+
{
68+
$mock = $this->getMock('PHP_CodeCoverage_Driver_PHPDBG');
69+
70+
$driver = new Stub();
71+
$this->assertTrue($driver->getDriver() === null);
72+
73+
$driver->setDriver($mock);
74+
$this->assertTrue($driver->getDriver() === $mock);
75+
}
76+
77+
/**
78+
* @requires OS WIN
79+
*/
80+
public function testStart()
81+
{
82+
$mock = $this->getMock('PHP_CodeCoverage_Driver_PHPDBG');
83+
$mock->expects($this->once())
84+
->method('start');
85+
86+
$driver = new Stub();
87+
$driver->setDriver($mock);
88+
$driver->start();
89+
}
90+
91+
/**
92+
* @requires OS WIN
93+
*/
94+
public function testStop()
95+
{
96+
$mock = $this->getMock('PHP_CodeCoverage_Driver_PHPDBG');
97+
$mock->expects($this->once())
98+
->method('stop');
99+
100+
$driver = new Stub();
101+
$driver->setDriver($mock);
102+
$driver->stop();
103+
}
104+
53105
}

0 commit comments

Comments
 (0)