Skip to content

Commit 0cf43ff

Browse files
minor symfony#24936 [Bridge\PhpUnit] Use phpdbg instead of xdebug in tests (nicolas-grekas)
This PR was merged into the 3.4 branch. Discussion ---------- [Bridge\PhpUnit] Use phpdbg instead of xdebug in tests | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - ping @lyrixx FYI Commits ------- abe3404 [Bridge\PhpUnit] Use phpdbg instead of xdebug in tests
2 parents b215ed5 + abe3404 commit 0cf43ff

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

src/Symfony/Bridge/PhpUnit/Tests/CoverageListenerTest.php

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,20 +16,24 @@ public function test()
1616
$this->markTestSkipped('This test cannot be run on HHVM.');
1717
}
1818

19-
exec('php --ri xdebug -d zend_extension=xdebug.so 2> /dev/null', $output, $returnCode);
20-
if (0 !== $returnCode) {
21-
$this->markTestSkipped('Xdebug is required to run this test.');
19+
if (\PHP_VERSION_ID >= 70000) {
20+
$php = 'phpdbg -qrr';
21+
} else {
22+
exec('php --ri xdebug -d zend_extension=xdebug.so 2> /dev/null', $output, $returnCode);
23+
if (0 !== $returnCode) {
24+
$this->markTestSkipped('Xdebug is required to run this test.');
25+
}
26+
$php = 'php -d zend_extension=xdebug.so';
2227
}
2328

2429
$dir = __DIR__.'/../Tests/Fixtures/coverage';
25-
$php = PHP_BINARY;
2630
$phpunit = $_SERVER['argv'][0];
2731

28-
exec("$php -d zend_extension=xdebug.so $phpunit -c $dir/phpunit-without-listener.xml.dist $dir/tests/ --coverage-text", $output);
32+
exec("$php $phpunit -c $dir/phpunit-without-listener.xml.dist $dir/tests/ --coverage-text", $output);
2933
$output = implode("\n", $output);
3034
$this->assertContains('FooCov', $output);
3135

32-
exec("$php -d zend_extension=xdebug.so $phpunit -c $dir/phpunit-with-listener.xml.dist $dir/tests/ --coverage-text", $output);
36+
exec("$php $phpunit -c $dir/phpunit-with-listener.xml.dist $dir/tests/ --coverage-text", $output);
3337
$output = implode("\n", $output);
3438
$this->assertNotContains('FooCov', $output);
3539
$this->assertContains("SutNotFoundTest::test\nCould not find the tested class.", $output);

0 commit comments

Comments
 (0)