Skip to content

Commit 59857e4

Browse files
authored
Merge pull request #7 from leanphp/appveyor
Appveyor - Windows CI
2 parents 0e927cc + 82128cd commit 59857e4

File tree

6 files changed

+119
-6
lines changed

6 files changed

+119
-6
lines changed

.appveyor.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
version: '{branch}-{build}'
2+
build: false
3+
shallow_clone: false
4+
platform: x64
5+
clone_folder: c:\projects\behat-code-coverage
6+
7+
environment:
8+
PHP_DOWNLOAD_FILE: 'php-7.1.2-nts-Win32-VC14-x86.zip'
9+
10+
#branches:
11+
#only:
12+
#- master
13+
14+
skip_commits:
15+
message: /\[ci skip\]/
16+
17+
#cache:
18+
#- c:\php -> appveyor.yml
19+
#- c:\php\composer.bat
20+
21+
init:
22+
- SET PATH=c:\php;%PATH%
23+
- SET COMPOSER_NO_INTERACTION=1
24+
- SET PHP=1
25+
- SET ANSICON=121x90 (121x90)
26+
- git config --global core.autocrlf input
27+
28+
install:
29+
- IF EXIST c:\php (SET PHP=0) ELSE (mkdir c:\php)
30+
- cd c:\php
31+
- IF %PHP%==1 appveyor DownloadFile http://windows.php.net/downloads/releases/archives/%PHP_DOWNLOAD_FILE%
32+
- IF %PHP%==1 7z x %PHP_DOWNLOAD_FILE% -y > 7z.log
33+
- IF %PHP%==1 echo @php %%~dp0composer.phar %%* > composer.bat
34+
- appveyor DownloadFile https://getcomposer.org/composer.phar
35+
- copy php.ini-production php.ini /Y
36+
- echo date.timezone="UTC" >> php.ini
37+
- echo extension_dir=ext >> php.ini
38+
- echo extension=php_openssl.dll >> php.ini
39+
- echo extension=php_curl.dll >> php.ini
40+
- echo extension=php_mbstring.dll >> php.ini
41+
- echo extension=php_fileinfo.dll >> php.ini
42+
# Xdebug
43+
- IF %PHP%==1 appveyor DownloadFile https://xdebug.org/files/php_xdebug-2.5.1-7.1-vc14-nts-x86_64.dll
44+
- mv php_xdebug-2.5.1-7.1-vc14-nts-x86_64.dll ext\
45+
- echo zend_extension="php_xdebug-2.5.1-7.1-vc14-nts-x86_64.dll" >> php.ini
46+
- echo xdebug.remote_enable=true >> php.ini
47+
- echo xdebug.remote_autostart=true >> php.ini
48+
- cd c:\projects\behat-code-coverage
49+
- composer self-update
50+
- composer install --no-progress --ansi
51+
52+
test_script:
53+
- cd c:\projects\behat-code-coverage
54+
- phpdbg -qrr vendor\phpunit\phpunit\phpunit -vvv
55+

CHANGELOG.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,17 @@ documented in this file.
66
The format is based on [Keep a Changelog](http://keepachangelog.com/)
77
and this project adheres to [Semantic Versioning](http://semver.org/).
88

9-
## [3.0.x-dev] - UNRELEASED (backported 3.0.x-dev from vipsoft/code-coverage-extension)
9+
## [3.0.0-RC1] - 2017-04-04 (backported 3.0.x-dev from vipsoft/code-coverage-extension)
1010

1111
- Merged commits from `3.0.x-dev` (`master` branch) of
1212
`vipsoft/code-coverage-extension` (adds support for Behat `~3.0`)
1313
- Fixed compatibility with Symfony `~2.3` and `~3.0` components (tested with
1414
versions `2.3`,`2.4`,`2.5`,`2.6`,`2.7`,`2.8`,`3.0`,`3.1`,`3.2`). As a result
1515
there are 2 different service definitions `services-2.3.xml` for Symfony
1616
`2.x` and `services.xml` for Symfony `3.x`).
17-
- Update TravisCI to test against all supported version of PHP.
17+
- Update Travis CI to test against all supported versions of PHP (`5.3` to
18+
`7.1`).
19+
- Enable windows based CI tests (appveyor).
1820
- Added `symfony/expression-language` as a dependency for users using older
1921
versions of PHP and symonfy `2.x` / `3.x`.
2022

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ behat-code-coverage
22
===================
33
[![Latest Stable Version](https://poser.pugx.org/leanphp/behat-code-coverage/v/stable)](https://packagist.org/packages/leanphp/behat-code-coverage)
44
[![Build Status][travis-image]][travis-url]
5+
[![Build status](https://ci.appveyor.com/api/projects/status/sos9oxh5chgx8d7h/branch/master?svg=true)](https://ci.appveyor.com/project/leanphp/behat-code-coverage/branch/master)
56
[![Latest Unstable Version](https://poser.pugx.org/leanphp/behat-code-coverage/v/unstable)](https://packagist.org/packages/leanphp/behat-code-coverage)
67
[![BSD-2-Clause License](https://poser.pugx.org/leanphp/behat-code-coverage/license)](https://packagist.org/packages/leanphp/behat-code-coverage)
78

composer.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@
3939
"phpunit/phpunit": "~4.0",
4040
"mikey179/vfsStream": "1.3.*"
4141
},
42+
"suggest": {
43+
"ext-xdebug": "Xdebug extension is required to collect coverage via Xdebug driver and run tests"
44+
},
4245
"autoload": {
4346
"psr-4": { "LeanPHP\\Behat\\CodeCoverage\\": "src/" }
4447
},

init.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
*/
1111

1212
spl_autoload_register(function($class) {
13-
if (false !== strpos($class, 'VIPSoft\\CodeCoverageExtension')) {
13+
if (false !== strpos($class, 'LeanPHP\\Behat\\CodeCoverage')) {
1414
require_once(__DIR__.'/src/'.str_replace('\\', '/', $class).'.php');
1515

1616
return true;

tests/Common/Driver/StubTest.php

Lines changed: 55 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,10 @@
1818
*/
1919
class StubTest extends TestCase
2020
{
21-
public function testGetterSetter()
21+
/**
22+
* @requires OS Linux
23+
*/
24+
public function testGetterSetterXdebug()
2225
{
2326
$mock = $this->getMock('PHP_CodeCoverage_Driver_Xdebug');
2427

@@ -29,7 +32,10 @@ public function testGetterSetter()
2932
$this->assertTrue($driver->getDriver() === $mock);
3033
}
3134

32-
public function testStart()
35+
/**
36+
* @requires OS Linux
37+
*/
38+
public function testStartXdebug()
3339
{
3440
$mock = $this->getMock('PHP_CodeCoverage_Driver_Xdebug');
3541
$mock->expects($this->once())
@@ -40,7 +46,10 @@ public function testStart()
4046
$driver->start();
4147
}
4248

43-
public function testStop()
49+
/**
50+
* @requires OS Linux
51+
*/
52+
public function testStopXdebug()
4453
{
4554
$mock = $this->getMock('PHP_CodeCoverage_Driver_Xdebug');
4655
$mock->expects($this->once())
@@ -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 testGetterSetterPHPDBG()
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 testStartPHPDBG()
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 testStopPHPDBG()
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)