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

PHP_CodeCoverage_Exception not handled properly #1935

Closed
sebastianbergmann opened this issue Nov 4, 2015 · 1 comment
Closed

PHP_CodeCoverage_Exception not handled properly #1935

sebastianbergmann opened this issue Nov 4, 2015 · 1 comment
Assignees
Labels
type/bug Something is broken

Comments

@sebastianbergmann
Copy link
Owner

Actual

$ phpunit --coverage-html /does-not-exist
PHPUnit 4.8.16-1-g54ee96a by Sebastian Bergmann and contributors.

Runtime:    PHP 5.6.15 with Xdebug 2.3.3
Configuration:  /usr/local/src/money/build/phpunit.xml

.............................................

Time: 794 ms, Memory: 13.00Mb

OK (45 tests, 71 assertions)

Generating code coverage report in Clover XML format ... done

Generating Crap4J report XML file ... done

Generating code coverage report in HTML format ...PHP Fatal error:  Uncaught exception 'PHP_CodeCoverage_Exception' with message 'Directory "/does-not-exist/" does not exist.' in /usr/local/src/phpunit/vendor/phpunit/php-code-coverage/src/CodeCoverage/Report/HTML.php:175
Stack trace:
#0 /usr/local/src/phpunit/vendor/phpunit/php-code-coverage/src/CodeCoverage/Report/HTML.php(67): PHP_CodeCoverage_Report_HTML->getDirectory('/does-not-exist')
#1 /usr/local/src/phpunit/src/TextUI/TestRunner.php(488): PHP_CodeCoverage_Report_HTML->process(Object(PHP_CodeCoverage), '/does-not-exist')
#2 /usr/local/src/phpunit/src/TextUI/Command.php(149): PHPUnit_TextUI_TestRunner->doRun(Object(PHPUnit_Framework_TestSuite), Array)
#3 /usr/local/src/phpunit/src/TextUI/Command.php(100): PHPUnit_TextUI_Command->run(Array, true)
#4 /usr/local/src/phpunit/phpunit(47): PHPUnit_TextUI_Command::main()
#5 {main}
  thrown in /usr/local/src/phpunit/vendor/phpunit/php-code-coverage/src/CodeCoverage/Report/HTML.php on line 175
$ phpunit --coverage-html /does-not-exist
PHPUnit 4.8.16-1-g54ee96a by Sebastian Bergmann and contributors.

Runtime:    PHP 5.6.15 with Xdebug 2.3.3
Configuration:  /usr/local/src/money/build/phpunit.xml

.............................................

Time: 797 ms, Memory: 13.25Mb

OK (45 tests, 71 assertions)

Generating code coverage report in Clover XML format ... done

Generating Crap4J report XML file ... done

Generating code coverage report in HTML format ... failed
Directory "/does-not-exist/" does not exist.

Generating code coverage report in PHPUnit XML format ... done

Expected

$ phpunit --coverage-html /does-not-exist
PHPUnit 4.8.16-1-g54ee96a by Sebastian Bergmann and contributors.

Runtime:    PHP 5.6.15 with Xdebug 2.3.3
Configuration:  /usr/local/src/money/build/phpunit.xml

.............................................

Time: 797 ms, Memory: 13.25Mb

OK (45 tests, 71 assertions)

Generating code coverage report in Clover XML format ... done

Generating Crap4J report XML file ... done

Generating code coverage report in HTML format ... failed
Directory "/does-not-exist/" does not exist.

Generating code coverage report in PHPUnit XML format ... done
@sebastianbergmann sebastianbergmann added the type/bug Something is broken label Nov 4, 2015
@sebastianbergmann sebastianbergmann self-assigned this Nov 4, 2015
@GrahamCampbell
Copy link
Contributor

I really like how you layout issues @sebastianbergmann. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/bug Something is broken
Projects
None yet
Development

No branches or pull requests

2 participants