Skip to content

Commit

Permalink
- Merge [5200].
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianbergmann committed Sep 7, 2009
1 parent df0b6ab commit c62eef8
Show file tree
Hide file tree
Showing 5 changed files with 77 additions and 3 deletions.
8 changes: 5 additions & 3 deletions PHPUnit/Framework/TestResult.php
Expand Up @@ -701,9 +701,11 @@ public function run(PHPUnit_Framework_Test $test)
$codeCoverage = xdebug_get_code_coverage();
xdebug_stop_code_coverage();

$this->appendCodeCoverageInformation(
$test, $codeCoverage
);
if (!$test instanceof PHPUnit_Framework_Warning) {
$this->appendCodeCoverageInformation(
$test, $codeCoverage
);
}
}

if ($errorHandlerSet === TRUE) {
Expand Down
36 changes: 36 additions & 0 deletions PHPUnit/Tests/TextUI/empty-testcase-coverage.phpt
@@ -0,0 +1,36 @@
--TEST--
phpunit --coverage-clover php://stdout EmptyTestCaseTest ../_files/EmptyTestCaseTest.php
--FILE--
<?php
$_SERVER['argv'][1] = '--no-configuration';
$_SERVER['argv'][2] = '--coverage-clover';
$_SERVER['argv'][3] = 'php://stdout';
$_SERVER['argv'][4] = 'EmptyTestCaseTest';
$_SERVER['argv'][5] = dirname(dirname(__FILE__)) . '/_files/EmptyTestCaseTest.php';

require_once dirname(dirname(dirname(__FILE__))) . '/TextUI/Command.php';
PHPUnit_TextUI_Command::main();
?>
--EXPECTF--
PHPUnit %s by Sebastian Bergmann.

F

Time: %i seconds

There was 1 failure:

1) Warning
No tests found in class "EmptyTestCaseTest".

%s:%i

FAILURES!
Tests: 1, Assertions: 0, Failures: 1.

Writing code coverage data to XML file, this may take a moment.<?xml version="1.0" encoding="UTF-8"?>
<coverage generated="%i" phpunit="%s">
<project name="EmptyTestCaseTest" timestamp="%i">
<metrics files="0" loc="0" ncloc="0" classes="0" methods="0" coveredmethods="0" statements="0" coveredstatements="0" elements="0" coveredelements="0"/>
</project>
</coverage>
27 changes: 27 additions & 0 deletions PHPUnit/Tests/TextUI/empty-testcase.phpt
@@ -0,0 +1,27 @@
--TEST--
phpunit EmptyTestCaseTest ../_files/EmptyTestCaseTest.php
--FILE--
<?php
$_SERVER['argv'][1] = '--no-configuration';
$_SERVER['argv'][2] = 'EmptyTestCaseTest';
$_SERVER['argv'][3] = dirname(dirname(__FILE__)) . '/_files/EmptyTestCaseTest.php';

require_once dirname(dirname(dirname(__FILE__))) . '/TextUI/Command.php';
PHPUnit_TextUI_Command::main();
?>
--EXPECTF--
PHPUnit %s by Sebastian Bergmann.

F

Time: %i seconds

There was 1 failure:

1) Warning
No tests found in class "EmptyTestCaseTest".

%s:%i

FAILURES!
Tests: 1, Assertions: 0, Failures: 1.
4 changes: 4 additions & 0 deletions PHPUnit/Tests/_files/EmptyTestCaseTest.php
@@ -0,0 +1,4 @@
<?php
class EmptyTestCaseTest extends PHPUnit_Framework_TestCase
{
}
5 changes: 5 additions & 0 deletions package.xml
Expand Up @@ -989,6 +989,8 @@
<file baseinstalldir="/" name="dependencies-isolation.phpt" role="test" />
<file baseinstalldir="/" name="dependencies2-isolation.phpt" role="test" />
<file baseinstalldir="/" name="dependencies3-isolation.phpt" role="test" />
<file baseinstalldir="/" name="empty-testcase.phpt" role="test" />
<file baseinstalldir="/" name="empty-testcase-coverage.phpt" role="test" />
<file baseinstalldir="/" name="exclude-group-isolation.phpt" role="test" />
<file baseinstalldir="/" name="exclude-group.phpt" role="test" />
<file baseinstalldir="/" name="failure-isolation.phpt" role="test" />
Expand Down Expand Up @@ -1110,6 +1112,9 @@
<file baseinstalldir="/" name="DoubleTestCase.php" role="test">
<tasks:replace from="@package_version@" to="version" type="package-info" />
</file>
<file baseinstalldir="/" name="EmptyTestCaseTest.php" role="test">
<tasks:replace from="@package_version@" to="version" type="package-info" />
</file>
<file baseinstalldir="/" name="Error.php" role="test">
<tasks:replace from="@package_version@" to="version" type="package-info" />
</file>
Expand Down

0 comments on commit c62eef8

Please sign in to comment.