Skip to content

Commit b25a772

Browse files
authored
Merge pull request #29 from leanphp/readme-fix
Erroneous default prefix fix
2 parents 09d264e + 3b533a4 commit b25a772

File tree

7 files changed

+55
-63
lines changed

7 files changed

+55
-63
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
bin/
22
nbproject/
33
vendor/
4+
build/
45
composer.phar
56
**/*.dbf
67
/composer.lock

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,15 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
88

99
## 3.x-dev
1010

11+
- Fixed a bug where a suffix when whitelisting files would default to `src`.
12+
This would make reports not generate in case no `suffix` was defined in
13+
configuration.
1114
- `phpunit/php-code-coverage` dependency version requirement has been updated
1215
from `~4.0|~5.0` to `~5.0` as we do not support version `4.0` anymore.
16+
- Updated README to list all configuration options
17+
- Updated `behat.yml.dist` so that it can be used as a proper example
18+
- `remote` driver is no longer activated by default
19+
- Version constraints in composer.json have been updated from `~` to `^`.
1320

1421

1522
## [3.2.0] - 2017-10-17 - Guzzle 6.0 support release

README.md

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -117,23 +117,35 @@ default:
117117
### Configuration Options
118118

119119
* `auth` - HTTP authentication options (optional).
120-
- `create` (`method` / `path`) - *TBA*.
121-
- `read` (`method` / `path`) - *TBA*.
122-
- `delete` (`method` / `path`) - *TBA*.
120+
- `create` (`method` / `path`) - override options for create method:
121+
- `method` - specify a method (default: `POST`)
122+
- `path` - specify path (default: `/`)
123+
- `read` (`method` / `path`) - override options (method and path) for read
124+
method.
125+
- `method` - specify a method (default: `GET`)
126+
- `path` - specify path (default: `/`)
127+
- `delete` (`method` / `path`) - override options (method and path) for delete
128+
method.
129+
- `method` - specify a method (default: `DELETE`)
130+
- `path` - specify path (default: `/`)
123131
- `drivers` - a list of drivers for gathering code coverage data:
124-
- `remote` - remote Xdebug driver.
125-
- `local` - local Xdebug driver.
132+
- `local` - local Xdebug driver (default).
133+
- `remote` - remote Xdebug driver (disabled by default).
126134
- `filter` - various filter options:
127-
- `forceCoversAnnotation` - *TBA*
128-
- `mapTestClassNameToCoveredClassName` - *TBA*
135+
- `forceCoversAnnotation` - (default: `false`)
136+
- `mapTestClassNameToCoveredClassName` - (default: `false`)
129137
- `whiltelist` - whitelist specific options:
130-
- `addUncoveredFilesFromWhiltelist` - *TBA*
131-
- `processUncoveredFilesFromWhitelist` - *TBA*
138+
- `addUncoveredFilesFromWhiltelist` - (default: `true`)
139+
- `processUncoveredFilesFromWhitelist` - (default: `false`)
132140
- `include` - a list of files or directories to include in whitelist:
133141
- `directories` - key containing whitelisted directories to include.
134-
- `files` - key containing whitelisted files to include.
142+
- `suffix` - suffix for files to be included (default: `.php`)
143+
- `prefix` - prefix of files to be included (optional)
144+
- `files` - a list containing whitelisted files to include.
135145
- `exclude` - a list of files or directories to exclude from whitelist:
136146
- `directories` - key containing whitelisted directories to exclude.
147+
- `suffix` - suffix for files to be included (default: `.php`)
148+
- `prefix` - prefix of files to be included (optional)
137149
- `files` - key containing whitelisted files to exclude.
138150
- `report` - reporter options:
139151
- `format` - specify report format (`html`, `clover`, `php`, `text`)

behat.yml.dist

Lines changed: 13 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -2,53 +2,25 @@ default:
22
extensions:
33
LeanPHP\Behat\CodeCoverage\Extension:
44
# optional authentication
5-
auth: ~
6-
# auth:
7-
# user: user
8-
# password: password
9-
create:
10-
method: POST
11-
path: /
12-
read:
13-
method: GET
14-
path: /
15-
delete:
16-
method: DELETE
17-
path: /
185
drivers:
19-
- remote
206
- local
21-
filter: ~
22-
# filter:
23-
# forceCoversAnnotation: false
24-
# mapTestClassNameToCoveredClassName: false
25-
# whitelist:
26-
# addUncoveredFilesFromWhitelist: true
27-
# processUncoveredFilesFromWhitelist: false
28-
# include:
29-
# directories:
30-
# 'some_path':
31-
# suffix: 'some_suffix'
32-
# prefix: 'some_prefix'
33-
# files:
34-
# - 'some_file'
35-
# exclude:
36-
# directories:
37-
# ...
38-
# files:
39-
# ...
40-
# blacklist:
41-
# include:
42-
# directories:
43-
# ...
7+
filter:
8+
forceCoversAnnotation: false
9+
mapTestClassNameToCoveredClassName: false
10+
whitelist:
11+
addUncoveredFilesFromWhitelist: true
12+
processUncoveredFilesFromWhitelist: false
13+
include:
14+
directories:
15+
'src': ~
4416
# files:
45-
# ...
17+
# - 'script.php'
4618
# exclude:
4719
# directories:
48-
# ...
20+
# 'vendor': ~
4921
# files:
50-
# ...
22+
# - src/script.php
5123
report:
5224
format: html
5325
options:
54-
target:: /tmp/report
26+
target: build/coverage-behat

composer.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,17 +26,17 @@
2626
},
2727
"require": {
2828
"php": ">=5.6",
29-
"phpunit/php-code-coverage": "~5.0",
30-
"behat/behat": "~3.0",
31-
"guzzlehttp/guzzle": "~6.0",
32-
"symfony/config": "~2.3||~3.0||~4.0",
33-
"symfony/dependency-injection": "~2.2||~3.0||~4.0",
34-
"symfony/expression-language": "~2.2||~3.0||~4.0",
35-
"symfony/http-kernel": "~2.3||~3.0||~4.0",
36-
"symfony/http-foundation": "~2.3||~3.0||~4.0"
29+
"phpunit/php-code-coverage": "^5.0",
30+
"behat/behat": "^3.0",
31+
"guzzlehttp/guzzle": "^6.0",
32+
"symfony/config": "^2.3||^3.0||^4.0",
33+
"symfony/dependency-injection": "^2.2||^3.0||^4.0",
34+
"symfony/expression-language": "^2.2||^3.0||^4.0",
35+
"symfony/http-kernel": "^2.3||^3.0||^4.0",
36+
"symfony/http-foundation": "^2.3||^3.0||^4.0"
3737
},
3838
"require-dev": {
39-
"phpunit/phpunit": "~6.0",
39+
"phpunit/phpunit": "^6.0",
4040
"mikey179/vfsStream": "1.6.*"
4141
},
4242
"suggest": {

src/Extension.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public function load(ContainerBuilder $container, array $config)
6363
}
6464

6565
if (! count($config['drivers'])) {
66-
$config['drivers'] = array('remote', 'local');
66+
$config['drivers'] = array('local');
6767
}
6868

6969
if (! count($config['report']['options'])) {
@@ -148,7 +148,7 @@ public function configure(ArrayNodeDefinition $builder)
148148
->useAttributeAsKey('name')
149149
->prototype('array')
150150
->children()
151-
->scalarNode('prefix')->defaultValue('src')->end()
151+
->scalarNode('prefix')->defaultValue('')->end()
152152
->scalarNode('suffix')->defaultValue('.php')->end()
153153
->end()
154154
->end()

tests/ExtensionTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ public function loadProvider()
242242
'method' => 'DELETE',
243243
'path' => '/',
244244
),
245-
'behat.code_coverage.config.drivers' => array('remote', 'local'),
245+
'behat.code_coverage.config.drivers' => array('local'),
246246
'behat.code_coverage.config.filter' => array(
247247
'whitelist' => array(
248248
'addUncoveredFilesFromWhitelist' => true,

0 commit comments

Comments
 (0)