8000 Erroneous default prefix fix by ek9 · Pull Request #29 · leanphp/behat-code-coverage · GitHub
[go: up one dir, main page]

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
bin/
nbproject/
vendor/
build/
composer.phar
**/*.dbf
/composer.lock
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,15 @@ and this project adheres to [Semantic Versioning](http://semver.org/).

## 3.x-dev

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


## [3.2.0] - 2017-10-17 - Guzzle 6.0 support release
Expand Down
32 changes: 22 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,23 +117,35 @@ default:
### Configuration Options

* `auth` - HTTP authentication options (optional).
- `create` (`method` / `path`) - *TBA*.
- `read` (`method` / `path`) - *TBA*.
- `delete` (`method` / `path`) - *TBA*.
- `create` (`method` / `path`) - override options for create method:
- `method` - specify a method (default: `POST`)
- `path` - specify path (default: `/`)
- `read` (`method` / `path`) - override options (method and path) for read
method.
- `method` - specify a method (default: `GET`)
- `path` - specify path (default: `/`)
- `delete` (`method` / `path`) - override options (method and path) for delete
method.
- `method` - specify a method (default: `DELETE`)
- `path` - specify path (default: `/`)
- `drivers` - a list of drivers for gathering code coverage data:
- `remote` - remote Xdebug driver.
- `local` - local Xdebug driver.
- `local` - local Xdebug driver (default).
- `remote` - remote Xdebug driver (disabled by default).
- `filter` - various filter options:
- `forceCoversAnnotation` - *TBA*
- `mapTestClassNameToCoveredClassName` - *TBA*
- `forceCoversAnnotation` - (default: `false`)
- `mapTestClassNameToCoveredClassName` - (default: `false`)
- `whiltelist` - whitelist specific options:
- `addUncoveredFilesFromWhiltelist` - *TBA*
- `processUncoveredFilesFromWhitelist` - *TBA*
- `addUncoveredFilesFromWhiltelist` - (default: `true`)
- `processUncoveredFilesFromWhitelist` - (default: `false`)
- `include` - a list of files or directories to include in whitelist:
- `directories` - key containing whitelisted directories to include.
- `files` - key containing whitelisted files to include.
- `suffix` - suffix for files to be included (default: `.php`)
- `prefix` - prefix of files to be included (optional)
- `files` - a list containing whitelisted files to include.
- `exclude` - a list of files or directories to exclude from whitelist:
- `directories` - key containing whitelisted directories to exclude.
- `suffix` - suffix for files to be included (default: `.php`)
- `prefix` - prefix of files to be included (optional)
- `files` - key containing whitelisted files to exclude.
- `report` - reporter options:
- `format` - specify report format (`html`, `clover`, `php`, `text`)
Expand Down
54 changes: 13 additions & 41 deletions behat.yml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -2,53 +2,25 @@ default:
extensions:
LeanPHP\Behat\CodeCoverage\Extension:
# optional authentication
auth: ~
# auth:
# user: user
# password: password
create:
method: POST
path: /
read:
method: GET
path: /
delete:
method: DELETE
path: /
drivers:
- remote
- local
filter: ~
# filter:
# forceCoversAnnotation: false
# mapTestClassNameToCoveredClassName: false
# whitelist:
# addUncoveredFilesFromWhitelist: true
# processUncoveredFilesFromWhitelist: false
# include:
# directories:
# 'some_path':
# suffix: 'some_suffix'
# prefix: 'some_prefix'
# files:
# - 'some_file'
# exclude:
# directories:
# ...
# files:
# ...
# blacklist:
# include:
# directories:
# ...
filter:
forceCoversAnnotation: false
mapTestClassNameToCoveredClassName: false
whitelist:
addUncoveredFilesFromWhitelist: true
processUncoveredFilesFromWhitelist: false
include:
directories:
'src': ~
# files:
# ...
# - 'script.php'
# exclude:
# directories:
# ...
# 'vendor': ~
# files:
# ...
# - src/script.php
report:
format: html
options:
target:: /tmp/report
target: build/coverage-behat
18 changes: 9 additions & 9 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,17 @@
},
"require": {
"php": ">=5.6",
"phpunit/php-code-coverage": "~5.0",
"behat/behat": "~3.0",
"guzzlehttp/guzzle": "~6.0",
"symfony/config": "~2.3||~3.0||~4.0",
"symfony/dependency-injection": "~2.2||~3.0||~4.0",
"symfony/expression-language": "~2.2||~3.0||~4.0",
"symfony/http-kernel": "~2.3||~3.0||~4.0",
"symfony/http-foundation": "~2.3||~3.0||~4.0"
"phpunit/php-code-coverage": "^5.0",
"behat/behat": "^3.0",
"guzzlehttp/guzzle": "^6.0",
"symfony/config": "^2.3||^3.0||^4.0",
"symfony/dependency-injection": "^2.2||^3.0||^4.0",
"symfony/expression-language": "^2.2||^3.0||^4.0",
"symfony/http-kernel": "^2.3||^3.0||^4.0",
"symfony/http-foundation": "^2.3||^3.0||^4.0"
},
"require-dev": {
"phpunit/phpunit": "~6.0",
"phpunit/phpunit": "^6.0",
"mikey179/vfsStream": "1.6.*"
},
"suggest": {
Expand Down
4 changes: 2 additions & 2 deletions src/Extension.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public function load(ContainerBuilder $container, array $config)
}

if (! count($config['drivers'])) {
$config['drivers'] = array('remote', 'local');
$config['drivers'] = array('local');
}

if (! count($config['report']['options'])) {
Expand Down Expand Up @@ -148,7 +148,7 @@ public function configure(ArrayNodeDefinition $builder)
->useAttributeAsKey('name')
->prototype('array')
->children()
->scalarNode('prefix')->defaultValue('src')->end()
->scalarNode('prefix')->defaultValue('')->end()
->scalarNode('suffix')->defaultValue('.php')->end()
->end()
->end()
Expand Down
2 changes: 1 addition & 1 deletion tests/ExtensionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ public function loadProvider()
'method' => 'DELETE',
'path' => '/',
),
'behat.code_coverage.config.drivers' => array('remote', 'local'),
'behat.code_coverage.config.drivers' => array('local'),
'behat.code_coverage.config.filter' => array(
'whitelist' => array(
'addUncoveredFilesFromWhitelist' => true,
Expand Down
0