Skip to content

Commit

Permalink
Added docs.
Browse files Browse the repository at this point in the history
  • Loading branch information
sun committed Jul 26, 2014
1 parent f0cacf9 commit 5269713
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/Framework/Exception.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,25 @@
*/

/**
* Base class for all PHPUnit Framework exceptions.
*
* Ensures that exceptions thrown during a test run do not leave stray
* references behind.
*
* Every Exception contains a stack trace. Each stack frame contains the 'args'
* of the called function. The function arguments can contain references to
* instantiated objects. The references prevent the objects from being
* destructed (until test results are eventually printed), so memory cannot be
* freed up.
*
* With enabled process isolation, test results are serialized in the child
* process and unserialized in the parent process. The stack trace of Exceptions
* may contain objects that cannot be serialized or unserialized (e.g., PDO
* connections). Unserializing user-space objects from the child process into
* the parent would break the intended encapsulation of process isolation.
*
* @see http://fabien.potencier.org/article/9/php-serialization-stack-traces-and-exceptions
*
* @package PHPUnit
* @subpackage Framework
* @author Sebastian Bergmann <sebastian@phpunit.de>
Expand Down
8 changes: 8 additions & 0 deletions src/Framework/ExceptionWrapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,14 @@
*/

/**
* Wraps Exceptions thrown by code under test.
*
* Re-instantiates Exceptions thrown by user-space code to retain their original
* class names, properties, and stack traces (but without arguments).
*
* Unlike PHPUnit_Framework_Exception, the complete stack of previous Exceptions
* is processed.
*
* @package PHPUnit
* @subpackage Framework
* @author Daniel F. Kudwien <sun@unleashedmind.com>
Expand Down

0 comments on commit 5269713

Please sign in to comment.