Skip to content
Browse files

- Do not try to get source for internal methods.

  • Loading branch information...
1 parent fd9ce9a commit 8e91151a0de967cf638207d4cc5efdbf78aaa5b2 @sebastianbergmann committed Jun 24, 2007
Showing with 9 additions and 5 deletions.
  1. +9 −5 PHPUnit/Framework/MockObject/Mock.php
View
14 PHPUnit/Framework/MockObject/Mock.php
@@ -210,11 +210,15 @@ protected function generateClassDefinition(ReflectionClass $class)
$code .= $this->generateMethodDefinition($this->className, $methodName, 'public');
}
} else {
- $code .= "\n" . str_replace(
- array($this->className . '::', 'self::'),
- $this->mockClassName . '::',
- PHPUnit_Util_Class::getMethodSource($this->className, $methodName)
- );
+ $method = $class->getMethod($methodName);
+
+ if (!$method->isInternal()) {
+ $code .= "\n" . str_replace(
+ array($this->className . '::', 'self::'),
+ $this->mockClassName . '::',
+ PHPUnit_Util_Class::getMethodSource($this->className, $methodName)
+ );
+ }
}
}

0 comments on commit 8e91151

Please sign in to comment.
Something went wrong with that request. Please try again.