diff --git a/.gitignore b/.gitignore index 43753c1..5213e46 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ bin/ nbproject/ vendor/ +build/ composer.phar **/*.dbf /composer.lock diff --git a/CHANGELOG.md b/CHANGELOG.md index aee05fd..f313097 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/README.md b/README.md index 42e7761..5e3e708 100644 --- a/README.md +++ b/README.md @@ -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`) diff --git a/behat.yml.dist b/behat.yml.dist index 57a9a25..f832429 100644 --- a/behat.yml.dist +++ b/behat.yml.dist @@ -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 diff --git a/composer.json b/composer.json index 8bc43c9..5b69c84 100644 --- a/composer.json +++ b/composer.json @@ -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": { diff --git a/src/Extension.php b/src/Extension.php index aa3a2f7..b08826c 100644 --- a/src/Extension.php +++ b/src/Extension.php @@ -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'])) { @@ -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() diff --git a/tests/ExtensionTest.php b/tests/ExtensionTest.php index 6a385a5..c1c761e 100644 --- a/tests/ExtensionTest.php +++ b/tests/ExtensionTest.php @@ -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,