Browse files

Fix reflection errors when PHPUnit_Framework_Warning is used.

  • Loading branch information...
1 parent f5e159b commit 6acd28ee691589c3d4f2b015846647abce9760de @sebastianbergmann sebastianbergmann committed Jan 19, 2012
Showing with 8 additions and 4 deletions.
  1. +1 −0 ChangeLog.markdown
  2. +5 −3 PHPUnit/Framework/TestCase.php
  3. +2 −1 PHPUnit/Framework/TestResult.php
View
1 ChangeLog.markdown
@@ -6,6 +6,7 @@ This is the list of changes for the PHPUnit 3.6 release series.
PHPUnit 3.6.8
-------------
+* Fixed reflection errors when `PHPUnit_Framework_Warning` is used.
* Marked `--skeleton-class` and `--skeleton-test` as deprecated. Please use the `phpunit-skelgen` tool that is provided by the `PHPUnit_SkeletonGenerator` package instead.
PHPUnit 3.6.7
View
8 PHPUnit/Framework/TestCase.php
@@ -666,9 +666,11 @@ public function run(PHPUnit_Framework_TestResult $result = NULL)
$result = $this->createResult();
}
- $this->setTestResultObject($result);
- $this->setUseErrorHandlerFromAnnotation();
- $this->setUseOutputBufferingFromAnnotation();
+ if (!$this instanceof PHPUnit_Framework_Warning) {
+ $this->setTestResultObject($result);
+ $this->setUseErrorHandlerFromAnnotation();
+ $this->setUseOutputBufferingFromAnnotation();
+ }
if ($this->useErrorHandler !== NULL) {
$oldErrorHandlerSetting = $result->getConvertErrorsToExceptions();
View
3 PHPUnit/Framework/TestResult.php
@@ -624,7 +624,8 @@ public function run(PHPUnit_Framework_Test $test)
PHP_Timer::start();
try {
- if ($this->strictMode &&
+ if (!$test instanceof PHPUnit_Framework_Warning &&
+ $this->strictMode &&
extension_loaded('pcntl') && class_exists('PHP_Invoker')) {
switch ($test->getSize()) {
case PHPUnit_Util_Test::SMALL: {

0 comments on commit 6acd28e

Please sign in to comment.