Fix conflicts between Bridge/PhpUnit and Debug fixtures

This commit is contained in:
Nicolas Grekas 2017-09-29 12:59:58 +02:00
parent ace6464d5c
commit 3392f9f32d
5 changed files with 10 additions and 10 deletions

View File

@ -27,11 +27,11 @@ class CoverageListenerTest extends TestCase
exec("$php -d zend_extension=xdebug.so $phpunit -c $dir/phpunit-without-listener.xml.dist $dir/tests/ --coverage-text", $output); exec("$php -d zend_extension=xdebug.so $phpunit -c $dir/phpunit-without-listener.xml.dist $dir/tests/ --coverage-text", $output);
$output = implode("\n", $output); $output = implode("\n", $output);
$this->assertContains('Foo', $output); $this->assertContains('FooCov', $output);
exec("$php -d zend_extension=xdebug.so $phpunit -c $dir/phpunit-with-listener.xml.dist $dir/tests/ --coverage-text", $output); exec("$php -d zend_extension=xdebug.so $phpunit -c $dir/phpunit-with-listener.xml.dist $dir/tests/ --coverage-text", $output);
$output = implode("\n", $output); $output = implode("\n", $output);
$this->assertNotContains('Foo', $output); $this->assertNotContains('FooCov', $output);
$this->assertContains("SutNotFoundTest::test\nCould not find the tested class.", $output); $this->assertContains("SutNotFoundTest::test\nCould not find the tested class.", $output);
$this->assertNotContains("CoversTest::test\nCould not find the tested class.", $output); $this->assertNotContains("CoversTest::test\nCould not find the tested class.", $output);
$this->assertNotContains("CoversDefaultClassTest::test\nCould not find the tested class.", $output); $this->assertNotContains("CoversDefaultClassTest::test\nCould not find the tested class.", $output);

View File

@ -11,11 +11,11 @@
namespace PhpUnitCoverageTest; namespace PhpUnitCoverageTest;
class Bar class BarCov
{ {
private $foo; private $foo;
public function __construct(Foo $foo) public function __construct(FooCov $foo)
{ {
$this->foo = $foo; $this->foo = $foo;
} }

View File

@ -11,7 +11,7 @@
namespace PhpUnitCoverageTest; namespace PhpUnitCoverageTest;
class Foo class FooCov
{ {
public function fooZ() public function fooZ()
{ {

View File

@ -17,12 +17,12 @@ class BarTest extends TestCase
{ {
public function testBar() public function testBar()
{ {
if (!class_exists('PhpUnitCoverageTest\Foo')) { if (!class_exists('PhpUnitCoverageTest\FooCov')) {
$this->markTestSkipped('This test is not part of the main Symfony test suite. It\'s here to test the CoverageListener.'); $this->markTestSkipped('This test is not part of the main Symfony test suite. It\'s here to test the CoverageListener.');
} }
$foo = new \PhpUnitCoverageTest\Foo(); $foo = new \PhpUnitCoverageTest\FooCov();
$bar = new \PhpUnitCoverageTest\Bar($foo); $bar = new \PhpUnitCoverageTest\BarCov($foo);
$this->assertSame('bar', $bar->barZ()); $this->assertSame('bar', $bar->barZ());
} }

View File

@ -9,8 +9,8 @@
* file that was distributed with this source code. * file that was distributed with this source code.
*/ */
require __DIR__.'/../src/Bar.php'; require __DIR__.'/../src/BarCov.php';
require __DIR__.'/../src/Foo.php'; require __DIR__.'/../src/FooCov.php';
require __DIR__.'/../../../../Legacy/CoverageListenerTrait.php'; require __DIR__.'/../../../../Legacy/CoverageListenerTrait.php';
if (class_exists('PHPUnit_Runner_Version') && version_compare(\PHPUnit_Runner_Version::id(), '6.0.0', '<')) { if (class_exists('PHPUnit_Runner_Version') && version_compare(\PHPUnit_Runner_Version::id(), '6.0.0', '<')) {