Skip to content

Commit 1e12ef1

Browse files
authored
refactor session
fix #6 #7 #8 #17
1 parent 146be51 commit 1e12ef1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+807
-943
lines changed

.editorconfig

+9-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,15 @@ indent_size = 2
7171
indent_style = space
7272
indent_size = 2
7373

74-
[behat.yml{,.dist}]
74+
[behat.yml{.dist}]
75+
indent_style = space
76+
indent_size = 2
77+
78+
[coverage.yml{,.dist}]
79+
indent_style = space
80+
indent_size = 2
81+
82+
[coverage.yaml{,.dist}]
7583
indent_style = space
7684
indent_size = 2
7785

.php_cs.dist

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ declare(strict_types=1);
55
$header = <<<'HEADER'
66
This file is part of the doyo/code-coverage project.
77
8-
(c) Anthonius Munthi <me@itstoni.com>
8+
(c) Anthonius Munthi <https://itstoni.com>
99
1010
For the full copyright and license information, please view the LICENSE
1111
file that was distributed with this source code.

README.md

+54-11
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,61 @@
11
Code Coverage
22
----
3-
This packages add functionality to customize code coverage collecting
3+
This packages making your code coverage collecting easy.
44

5-
[![License](https://img.shields.io/packagist/l/doyo/code-coverage.svg?style=flat-square)](https://github.com/doyolabs/code-coverage/blob/master/LICENSE)
6-
[![Build Status][travis-master]][travis]
7-
[![Coverage][cover-stat-master]][cover-master]
8-
[![Score][score-stat-master]][score-master]
5+
| Project | License | Version | Build | Coverage | Score |
6+
| :---: | :---: | :---: | :---: | :---: | :---: |
7+
| [main project][main] | [![License][main-license-badge]][main-license] | [![Version][main-version-badge]][main-version] | [![Build Status][main-travis-badge]][main-travis] | [![Coverage][main-cover-badge]][main-cover] | [![Score][main-score-badge]][main-score] |
8+
| [code-coverage-bridge][bridge] | [![License][bridge-license-badge]][bridge-license] | [![Version][bridge-version-badge]][bridge-version] | [![Build Status][bridge-travis-badge]][bridge-travis] | [![Coverage][bridge-cover-badge]][bridge-cover] | [![Score][bridge-score-badge]][bridge-score] |
9+
| [behat-code-coverage][behat] | [![License][behat-license-badge]][behat-license] | [![Version][behat-version-badge]][behat-version] | [![Build Status][behat-travis-badge]][behat-travis] | [![Coverage][behat-cover-badge]][behat-cover] | [![Score][behat-score-badge]][behat-score] |
10+
| [phpspec-code-coverage][phpspec] | [![License][phpspec-license-badge]][phpspec-license] | [![Version][phpspec-version-badge]][phpspec-version] | [![Build Status][phpspec-travis-badge]][phpspec-travis] | [![Coverage][phpspec-cover-badge]][phpspec-cover] | [![Score][phpspec-score-badge]][phpspec-score] |
911

10-
[travis]: https://travis-ci.com/doyolabs/code-coverage
11-
[travis-master]: https://img.shields.io/travis/com/doyolabs/code-coverage/master.svg?style=flat-square
12-
[cover-master]: https://coveralls.io/github/doyolabs/code-coverage?branch=master
13-
[cover-stat-master]: https://img.shields.io/coveralls/github/doyolabs/code-coverage/master.svg?style=flat-square
14-
[score-master]: https://scrutinizer-ci.com/g/doyolabs/code-coverage/?branch=master
15-
[score-stat-master]: https://img.shields.io/scrutinizer/quality/g/doyolabs/code-coverage/master.svg?style=flat-square
12+
[main]: https://github.com/doyolabs/code-coverage-bridge
13+
[main-version]: https://packagist.org/packages/doyo/code-coverage
14+
[main-version-badge]: https://img.shields.io/packagist/vpre/doyo/code-coverage.svg?style=flat-square
15+
[main-license]: https://github.com/doyolabs/code-coverage/blob/master/LICENSE
16+
[main-license-badge]: https://img.shields.io/packagist/l/doyo/code-coverage.svg?style=flat-square
17+
[main-travis]: https://travis-ci.com/doyolabs/code-coverage
18+
[main-travis-badge]: https://img.shields.io/travis/com/doyolabs/code-coverage/master.svg?style=flat-square
19+
[main-cover]: https://coveralls.io/github/doyolabs/code-coverage?branch=master
20+
[main-cover-badge]: https://img.shields.io/coveralls/github/doyolabs/code-coverage/master.svg?style=flat-square
21+
[main-score]: https://scrutinizer-ci.com/g/doyolabs/code-coverage/?branch=master
22+
[main-score-badge]: https://img.shields.io/scrutinizer/quality/g/doyolabs/code-coverage/master.svg?style=flat-square
23+
24+
[bridge]: https://github.com/doyolabs/code-coverage-bridge
25+
[bridge-license]: https://github.com/doyolabs/code-coverage-bridge/blob/master/LICENSE
26+
[bridge-license-badge]: https://img.shields.io/packagist/l/doyo/code-coverage-bridge.svg?style=flat-square
27+
[bridge-version]: https://packagist.org/packages/doyo/code-coverage-bridge
28+
[bridge-version-badge]: https://img.shields.io/packagist/vpre/doyo/code-coverage-bridge.svg?style=flat-square
29+
[bridge-travis]: https://travis-ci.com/doyolabs/code-coverage-bridge
30+
[bridge-travis-badge]: https://img.shields.io/travis/com/doyolabs/code-coverage-bridge/master.svg?style=flat-square
31+
[bridge-cover]: https://coveralls.io/github/doyolabs/code-coverage-bridge?branch=master
32+
[bridge-cover-badge]: https://img.shields.io/coveralls/github/doyolabs/code-coverage-bridge/master.svg?style=flat-square
33+
[bridge-score]: https://scrutinizer-ci.com/g/doyolabs/code-coverage-bridge/?branch=master
34+
[bridge-score-badge]: https://img.shields.io/scrutinizer/quality/g/doyolabs/code-coverage-bridge/master.svg?style=flat-square
35+
36+
[behat]: https://github.com/doyolabs/behat-code-coverage
37+
[behat-license]: https://github.com/doyolabs/behat-code-coverage/blob/master/LICENSE
38+
[behat-license-badge]: https://img.shields.io/packagist/l/doyo/behat-code-coverage.svg?style=flat-square
39+
[behat-version]: https://packagist.org/packages/doyo/behat-code-coverage
40+
[behat-version-badge]: https://img.shields.io/packagist/vpre/doyo/behat-code-coverage.svg?style=flat-square
41+
[behat-travis]: https://travis-ci.com/doyolabs/behat-code-coverage
42+
[behat-travis-badge]: https://img.shields.io/travis/com/doyolabs/behat-code-coverage/master.svg?style=flat-square
43+
[behat-cover]: https://coveralls.io/github/doyolabs/behat-code-coverage?branch=master
44+
[behat-cover-badge]: https://img.shields.io/coveralls/github/doyolabs/behat-code-coverage/master.svg?style=flat-square
45+
[behat-score]: https://scrutinizer-ci.com/g/doyolabs/behat-code-coverage/?branch=master
46+
[behat-score-badge]: https://img.shields.io/scrutinizer/quality/g/doyolabs/behat-code-coverage/master.svg?style=flat-square
47+
48+
[phpspec]: https://github.com/doyolabs/phpspec-code-coverage
49+
[phpspec-license]: https://github.com/doyolabs/phpspec-code-coverage/blob/master/LICENSE
50+
[phpspec-license-badge]: https://img.shields.io/packagist/l/doyo/phpspec-code-coverage.svg?style=flat-square
51+
[phpspec-version]: https://packagist.org/packages/doyo/phpspec-code-coverage
52+
[phpspec-version-badge]: https://img.shields.io/packagist/vpre/doyo/phpspec-code-coverage.svg?style=flat-square
53+
[phpspec-travis]: https://travis-ci.com/doyolabs/phpspec-code-coverage
54+
[phpspec-travis-badge]: https://img.shields.io/travis/com/doyolabs/phpspec-code-coverage/master.svg?style=flat-square
55+
[phpspec-cover]: https://coveralls.io/github/doyolabs/phpspec-code-coverage?branch=master
56+
[phpspec-cover-badge]: https://img.shields.io/coveralls/github/doyolabs/phpspec-code-coverage/master.svg?style=flat-square
57+
[phpspec-score]: https://scrutinizer-ci.com/g/doyolabs/phpspec-code-coverage/?branch=master
58+
[phpspec-score-badge]: https://img.shields.io/scrutinizer/quality/g/doyolabs/phpspec-code-coverage/master.svg?style=flat-square
1659

1760
About
1861
----

behat.yaml.dist

+5-14
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ default:
22
suites:
33
default:
44
paths:
5-
- '%paths.base%/src/code-coverage/Resources/features'
6-
- '%paths.base%/src/phpspec-extension/Resources/features'
5+
- '%paths.base%/src/bridge/Resources/features'
6+
- '%paths.base%/src/phpspec/Resources/features'
77
contexts:
88
- Doyo\Bridge\CodeCoverage\Context\ContainerContext
99
- Doyo\Bridge\CodeCoverage\Context\CoverageContext
@@ -12,17 +12,8 @@ default:
1212

1313
extensions:
1414
Doyo\Behat\CodeCoverage\Extension:
15-
filter:
16-
- directory: src
17-
exclude:
18-
- src/*/Resources
19-
- src/*/Context
20-
- src/*/Spec
21-
- src/*/vendor
22-
- src/*/build
23-
- file: src/bridge/RoboFile.php
24-
- file: src/phpspec/RoboFile.php
25-
- file: src/behat/RoboFile.php
15+
imports:
16+
- coverage.yaml
2617
reports:
2718
html: build/behat
28-
php: build/cov/02-behat.cov
19+
php: build/cov/behat.cov

bin/coverage

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../src/bridge/Resources/bin/coverage

composer.json

+4-5
Original file line numberDiff line numberDiff line change
@@ -36,19 +36,18 @@
3636
},
3737
"require": {
3838
"php": ">=7.0",
39+
"behat/behat": "^3.5",
40+
"doyo/symfony-bridge": "^1.0@dev",
3941
"phpunit/php-code-coverage": "^4.3 | >=5.0",
4042
"sebastian/environment": "^3.1 | ^4.2",
41-
"doyo/symfony-bridge": "^1.0@dev",
42-
"symfony/event-dispatcher": "^3.4 | ^4.0",
43-
"symfony/dependency-injection": "^3.4 | ^4.0",
4443
"symfony/config": "^3.4 | ^4.0",
45-
"behat/behat": "^3.5"
44+
"symfony/dependency-injection": "^3.4 | ^4.0",
45+
"symfony/event-dispatcher": "^3.4 | ^4.0"
4646
},
4747
"require-dev": {
4848
"guzzlehttp/guzzle": "^6.3",
4949
"phpspec/phpspec": "^4.3 | ^5.0",
5050
"phpunit/phpcov": "^4.0 | >=5.0",
51-
"phpunit/phpunit": ">=6.0",
5251
"symfony/cache": "^3.4",
5352
"symfony/console": "^3.4 | ^4.3",
5453
"symfony/http-foundation": "^3.4 | ^4.3",

coverage.yaml

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
debug: true
2+
filter:
3+
- directory: src
4+
exclude:
5+
- src/*/Driver
6+
- src/*/Resources
7+
- src/*/Context
8+
- src/*/Spec
9+
- src/*/vendor
10+
- src/*/build
11+
- file: src/*/RoboFile.php

phpspec.yaml.dist

+3-12
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,8 @@ suites:
2323

2424
extensions:
2525
Doyo\PhpSpec\CodeCoverage\Extension:
26-
filter:
27-
- directory: src
28-
exclude:
29-
- src/*/Resources
30-
- src/*/Context
31-
- src/*/Spec
32-
- src/*/vendor
33-
- src/*/build
34-
- file: src/bridge/RoboFile.php
35-
- file: src/phpspec/RoboFile.php
36-
- file: src/behat/RoboFile.php
26+
imports:
27+
- coverage.yaml
3728
reports:
38-
php: build/cov/01-phpspec.cov
29+
php: build/cov/phpspec.cov
3930
html: build/phpspec

src/behat/README.md

+18-17
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,27 @@
1-
Behat Coverage Extension [![License](https://img.shields.io/packagist/l/doyo/behat-code-coverage.svg?style=flat-square)](#License)
1+
Behat Code Coverage Extension
22
---
33
Provide code coverage extension during behat tests
44

5-
### Status
6-
| Branch | Status | Coverage | Score |
7-
| :---: | :---: | :---: | :---: |
8-
| **master** | [![Build Status][travis-master]][travis] | [![Coverage][cover-stat-master]][cover-master] | [![Score][score-stat-master]][score-master]
9-
| **develop** | [![Build Status][travis-develop]][travis] | [![Coverage][cover-stat-develop]][cover-develop] | [![Score][score-stat-develop]][score-develop]
5+
[![License][behat-license-badge]][behat-license]
6+
[![Version][behat-version-badge]][behat-version]
7+
[![Build Status][behat-travis-badge]][behat-travis]
8+
[![Coverage][behat-cover-badge]][behat-cover]
9+
[![Score][behat-score-badge]][behat-score]
10+
1011

1112
### Support
1213
* PHP: >=7.0
1314
* Behat: >=3.0
1415
* PHP Code Coverage: >=5.3
1516

16-
[travis]: https://travis-ci.com/doyolabs/behat-code-coverage
17-
[travis-master]: https://img.shields.io/travis/com/doyolabs/behat-code-coverage/master.svg?style=flat-square
18-
[travis-develop]: https://img.shields.io/travis/com/doyolabs/behat-code-coverage/develop.svg?style=flat-square
19-
[cover-master]: https://coveralls.io/github/doyolabs/behat-code-coverage?branch=master
20-
[cover-develop]: https://coveralls.io/github/doyolabs/behat-code-coverage?branch=develop
21-
[cover-stat-develop]: https://img.shields.io/coveralls/github/doyolabs/behat-code-coverage/develop.svg?style=flat-square
22-
[cover-stat-master]: https://img.shields.io/coveralls/github/doyolabs/behat-code-coverage/master.svg?style=flat-square
23-
[score-master]: https://scrutinizer-ci.com/g/doyolabs/behat-code-coverage/?branch=master
24-
[score-develop]: https://scrutinizer-ci.com/g/doyolabs/behat-code-coverage/?branch=develop
25-
[score-stat-develop]: https://img.shields.io/scrutinizer/quality/g/doyolabs/behat-code-coverage/develop.svg?style=flat-square
26-
[score-stat-master]: https://img.shields.io/scrutinizer/quality/g/doyolabs/behat-code-coverage/master.svg?style=flat-square
17+
[behat]: https://github.com/doyolabs/behat-code-coverage
18+
[behat-license]: https://github.com/doyolabs/behat-code-coverage/blob/master/LICENSE
19+
[behat-license-badge]: https://img.shields.io/packagist/l/doyo/behat-code-coverage.svg?style=flat-square
20+
[behat-version]: https://packagist.org/packages/doyo/behat-code-coverage
21+
[behat-version-badge]: https://img.shields.io/packagist/vpre/doyo/behat-code-coverage.svg?style=flat-square
22+
[behat-travis]: https://travis-ci.com/doyolabs/behat-code-coverage
23+
[behat-travis-badge]: https://img.shields.io/travis/com/doyolabs/behat-code-coverage/master.svg?style=flat-square
24+
[behat-cover]: https://coveralls.io/github/doyolabs/behat-code-coverage?branch=master
25+
[behat-cover-badge]: https://img.shields.io/coveralls/github/doyolabs/behat-code-coverage/master.svg?style=flat-square
26+
[behat-score]: https://scrutinizer-ci.com/g/doyolabs/behat-code-coverage/?branch=master
27+
[behat-score-badge]: https://img.shields.io/scrutinizer/quality/g/doyolabs/behat-code-coverage/master.svg?style=flat-square

src/bridge/Compiler/CoveragePass.php

+11-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,17 @@ private function filterWhitelist(Definition $definition, $options, $method)
8080
}
8181

8282
if ('file' === $type) {
83-
$definition->addMethodCall($method.'File'.$methodSuffix, [$file]);
83+
84+
$files = [$file];
85+
86+
if(false !== ($pos=strpos($file, '*'))){
87+
$files = [];
88+
foreach(glob($file) as $filename){
89+
$files[] = $filename;
90+
}
91+
}
92+
93+
$definition->addMethodCall($method.'File'.$methodSuffix, $files);
8494
}
8595
}
8696
}

src/bridge/Configuration.php

+4
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,11 @@ private function configureCoverageSection(ArrayNodeDefinition $node)
5858
{
5959
$node
6060
->children()
61+
->arrayNode('imports')
62+
->scalarPrototype()->end()
63+
->end()
6164
->booleanNode('xdebug_patch')->defaultTrue()->end()
65+
->booleanNode('debug')->defaultFalse()->end()
6266
->arrayNode('coverage')
6367
->addDefaultsIfNotSet()
6468
->children()

src/bridge/Console/Application.php

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?php
2+
3+
4+
namespace Doyo\Bridge\CodeCoverage\Console;
5+
6+
use Symfony\Component\Console\Application as BaseApplication;
7+
8+
class Application extends BaseApplication
9+
{
10+
11+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?php
2+
3+
namespace Doyo\Bridge\CodeCoverage\Console;
4+
5+
6+
use Symfony\Component\Console\Command\Command;
7+
use Symfony\Component\Console\Input\InputInterface;
8+
use Symfony\Component\Console\Output\OutputInterface;
9+
10+
class MergeCoverageCommand extends Command
11+
{
12+
public function execute(InputInterface $input, OutputInterface $output)
13+
{
14+
15+
}
16+
}

0 commit comments

Comments
 (0)