Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

missed phpdbg driver enabled + proper run example in README #42

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ If you execute `bin/behat` command, you will see code coverage generated in
This extension now supports [phpdbg][6], which results in faster execution when
using more recent versions of PHP. Run `phpspec` via [phpdbg][6]:

$ phpdbg -qrr bin/behat run
$ phpdbg -qrr bin/behat

## Configuration

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
},
"require": {
"php": ">=5.6",
"phpunit/php-code-coverage": "^6.0",
"phpunit/php-code-coverage": "^9.0",
"behat/behat": "^3.0",
"guzzlehttp/guzzle": "^6.0",
"symfony/config": "^2.3||^3.0||^4.0",
Expand Down
11 changes: 11 additions & 0 deletions src/Common/Report/Php.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,17 @@ public function __construct(array $options)
*/
public function process(CodeCoverage $coverage)
{
if (getenv('ENV_TEST_INC_NUMBER')) {
$slot = getenv('ENV_TEST_INC_NUMBER');
} else {
$slot = '1';
}

$suite = getenv('BEHAT_PHING_TARGET') ? getenv('BEHAT_PHING_TARGET') : 'default';

$this->options['target'] = str_replace('{n}', $slot, $this->options['target']);
$this->options['target'] = str_replace('{suite}', $suite, $this->options['target']);

return $this->report->process(
$coverage,
$this->options['target']
Expand Down
6 changes: 6 additions & 0 deletions src/Resources/config/services-2.3.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
<parameter key="report">%behat.code_coverage.config.report%</parameter>
</parameter>

<parameter key="vipsoft.code_coverage.driver.phpdbg.class">SebastianBergmann\CodeCoverage\Driver\PHPDBG</parameter>
<parameter key="vipsoft.code_coverage.driver.hhmv.class">LeanPHP\Behat\CodeCoverage\Common\Driver\HHVM</parameter>
<parameter key="vipsoft.code_coverage.driver.xcache.class">LeanPHP\Behat\CodeCoverage\Common\Driver\XCache</parameter>
<parameter key="vipsoft.code_coverage.driver.xdebug.class">SebastianBergmann\CodeCoverage\Driver\Xdebug</parameter>
Expand All @@ -37,6 +38,11 @@
<tag name="cli.controller" priority="80000" />
</service>

<service id="vipsoft.code_coverage.driver.phpdbg"
class="%vipsoft.code_coverage.driver.phpdbg.class%"
synthetic="true">
<tag name="vipsoft.code_coverage.driver"/>
</service>
<service id="vipsoft.code_coverage.driver.hhmv"
class="%vipsoft.code_coverage.driver.hhmv.class%"
synthetic="true">
Expand Down
6 changes: 6 additions & 0 deletions src/Resources/config/services.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
<parameter key="report">%behat.code_coverage.config.report%</parameter>
</parameter>

<parameter key="vipsoft.code_coverage.driver.phpdbg.class">SebastianBergmann\CodeCoverage\Driver\PHPDBG</parameter>
<parameter key="vipsoft.code_coverage.driver.hhmv.class">LeanPHP\Behat\CodeCoverage\Common\Driver\HHVM</parameter>
<parameter key="vipsoft.code_coverage.driver.xcache.class">LeanPHP\Behat\CodeCoverage\Common\Driver\XCache</parameter>
<parameter key="vipsoft.code_coverage.driver.xdebug.class">SebastianBergmann\CodeCoverage\Driver\Xdebug</parameter>
Expand All @@ -37,6 +38,11 @@
<tag name="cli.controller" priority="80000" />
</service>

<service id="vipsoft.code_coverage.driver.phpdbg"
class="%vipsoft.code_coverage.driver.phpdbg.class%"
synthetic="true">
<tag name="vipsoft.code_coverage.driver"/>
</service>
<service id="vipsoft.code_coverage.driver.hhmv"
class="%vipsoft.code_coverage.driver.hhmv.class%"
synthetic="true">
Expand Down