\PHPUnit_Framework_Exception
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.
- Author: Sebastian Bergmann <sebastian@phpunit.de>
- Copyright: 2001-2014 Sebastian Bergmann <sebastian@phpunit.de>
- License: http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License
Synopsis
- // members
- protected array $serializableTrace;
- // Inherited members from RuntimeException
- protected $message;
- protected $code;
- protected $file;
- protected $line;
- // Inherited members from Exception
- protected $message;
- protected $code;
- protected $file;
- protected $line;
- // methods
- public void __construct()
- public array getSerializableTrace()
- public string __toString()
- public void __sleep()
- // Inherited methods from RuntimeException
- public final string getMessage()
- public final Exception getPrevious()
- public final mixed getCode()
- public final string getFile()
- public final int getLine()
- public final array getTrace()
- public final string getTraceAsString()
- public string __toString()
- // Inherited methods from Exception
- public void __construct()
- public final string getMessage()
- public final Exception getPrevious()
- public final mixed getCode()
- public final string getFile()
- public final int getLine()
- public final array getTrace()
- public final string getTraceAsString()
- public string __toString()
Hierarchy
Extends
Extended by
- PHPUnit_Framework_RiskyTestError
- PHPUnit_Framework_ExceptionWrapper
- PHPUnit_Framework_ExpectationFailedException
- PHPUnit_Framework_SkippedTestError
- PHPUnit_Framework_SyntheticError
- PHPUnit_Framework_IncompleteTestError
- PHPUnit_Framework_SkippedTestSuiteError
- PHPUnit_Framework_InvalidCoversTargetError
- PHPUnit_Framework_CodeCoverageException
- PHPUnit_Framework_UnintentionallyCoveredCodeError
- PHPUnit_Framework_OutputError
- PHPUnit_Framework_InvalidCoversTargetException
- PHPUnit_Framework_Error_Warning
- PHPUnit_Framework_Error_Deprecated
- PHPUnit_Framework_Error_Notice
- PHPUnit_Framework_Error
- PHPUnit_Framework_AssertionFailedError
Implements
Violations
PHPMessDetector
Line | Rule | Message |
---|---|---|
86 | UnusedLocalVariable | Avoid unused local variables such as '$call'. |
Members
protected
- $code
—
int
The exception code - $code
—
int
The exception code - $file
—
string
The filename where the exception was created - $file
—
string
The filename where the exception was created - $line
—
int
The line where the exception was created - $line
—
int
The line where the exception was created - $message
—
string
The exception message - $message
—
string
The exception message - $serializableTrace — array
Methods
public
- __construct()
- __sleep()
- __toString()
- getSerializableTrace() — Returns the serializable trace (without 'args').
Inherited from RuntimeException
public
Inherited from Exception
public
- __toString() — String representation of the exception
- getCode() — Gets the Exception code
- getFile() — Gets the file in which the exception occurred
- getLine() — Gets the line in which the exception occurred
- getMessage() — Gets the Exception message
- getPrevious() — Returns previous Exception
- getTrace() — Gets the stack trace
- getTraceAsString() — Gets the stack trace as a string
History
-
2014-07-26T23:04:49+02:00 (commit #6529e40)
Author: sun (sun@unleashedmind.com) / Commiter: sun (sun@unleashedmind.com)
Fix #1351: Isolated TestResult contains serialized test class upon failure.
-
2014-01-20T17:21:13+01:00 (commit #3a5808f)
Author: Sebastian Bergmann (sb@sebastian-bergmann.de) / Commiter: Sebastian Bergmann (sb@sebastian-bergmann.de)
Cleanup
-
2014-01-09T08:11:47+01:00 (commit #205e008)
Author: Sebastian Bergmann (sb@sebastian-bergmann.de) / Commiter: Sebastian Bergmann (sb@sebastian-bergmann.de)
Bump copyright year
-
2013-06-29T08:44:56+02:00 (commit #5144121)
Author: Sebastian Bergmann (sb@sebastian-bergmann.de) / Commiter: Sebastian Bergmann (sb@sebastian-bergmann.de)
Refactor PHPUnit_Framework_Exception
-
2013-01-07T11:37:52+01:00 (commit #c517984)
Author: Sebastian Bergmann (sb@sebastian-bergmann.de) / Commiter: Sebastian Bergmann (sb@sebastian-bergmann.de)
Bump copyright year
-
2012-09-24T06:47:44+02:00 (commit #81ab540)
Author: Sebastian Bergmann (sb@sebastian-bergmann.de) / Commiter: Sebastian Bergmann (sb@sebastian-bergmann.de)
Do not perform string replacement for @package_version@ anymore.
-
2012-04-30T12:02:38+02:00 (commit #5786e50)
Author: Sebastian Bergmann (sb@sebastian-bergmann.de) / Commiter: Sebastian Bergmann (sb@sebastian-bergmann.de)
List The BSD 3-Clause License correctly and consistently. Thanks to Christian Aistleitner <christian@quelltextlich.at> for bringing this issue to my attention.
-
2012-01-01T11:21:16+01:00 (commit #aae6c38)
Author: Sebastian Bergmann (sb@sebastian-bergmann.de) / Commiter: Sebastian Bergmann (sb@sebastian-bergmann.de)
Bump copyright year.
-
2010-12-31T11:45:34+01:00 (commit #bee3344)
Author: Sebastian Bergmann (sb@sebastian-bergmann.de) / Commiter: Sebastian Bergmann (sb@sebastian-bergmann.de)
Bump copyright year.
-
2010-07-07T12:42:23+02:00 (commit #f0d9cdd)
Author: Sebastian Bergmann (sb@sebastian-bergmann.de) / Commiter: Sebastian Bergmann (sb@sebastian-bergmann.de)
Change email address.
-
2010-06-12T20:25:54+02:00 (commit #d19a737)
Author: Mark Story (mark@mark-story.com) / Commiter: Mark Story (mark@mark-story.com)
Removing trailing whitespace from files. Refs #1063
-
2010-04-05T17:41:26+02:00 (commit #471d69e)
Author: Sebastian Bergmann (sb@sebastian-bergmann.de) / Commiter: Sebastian Bergmann (sb@sebastian-bergmann.de)
Add @subpackage annotation.
-
2010-02-02T14:14:29+01:00 (commit #bc1aaaa)
Author: Sebastian Bergmann (sb@sebastian-bergmann.de) / Commiter: Sebastian Bergmann (sb@sebastian-bergmann.de)
Remove closing PHP tags.
-
2010-01-19T09:39:03+01:00 (commit #fb48a69)
Author: Sebastian Bergmann (sb@sebastian-bergmann.de) / Commiter: Sebastian Bergmann (sb@sebastian-bergmann.de)
Initial work on autoloading.
-
2009-12-31T09:26:09+01:00 (commit #37f75ff)
Author: Sebastian Bergmann (sb@sebastian-bergmann.de) / Commiter: Sebastian Bergmann (sb@sebastian-bergmann.de)
Bump copyright year.
-
2009-12-31T09:25:53+01:00 (commit #bddcc5f)
Author: Sebastian Bergmann (sb@sebastian-bergmann.de) / Commiter: Sebastian Bergmann (sb@sebastian-bergmann.de)
Bump copyright year.
-
2009-12-31T09:23:37+01:00 (commit #7a7d0b7)
Author: Sebastian Bergmann (sb@sebastian-bergmann.de) / Commiter: Sebastian Bergmann (sb@sebastian-bergmann.de)
Bump copyright year.
-
2009-12-25T10:32:26+01:00 (commit #60e7125)
Author: Sebastian Bergmann (sb@sebastian-bergmann.de) / Commiter: Sebastian Bergmann (sb@sebastian-bergmann.de)
Remove Subversion keywords.
-
2009-12-25T10:30:57+01:00 (commit #42294ad)
Author: Sebastian Bergmann (sb@sebastian-bergmann.de) / Commiter: Sebastian Bergmann (sb@sebastian-bergmann.de)
Remove Subversion keywords.
-
2009-12-25T10:26:35+01:00 (commit #8617133)
Author: Sebastian Bergmann (sb@sebastian-bergmann.de) / Commiter: Sebastian Bergmann (sb@sebastian-bergmann.de)
Remove Subversion keywords.
-
2009-11-23T09:39:24+01:00 (commit #1503412)
Author: Sebastian Bergmann (sb@sebastian-bergmann.de) / Commiter: Sebastian Bergmann (sb@sebastian-bergmann.de)
Merge [5389].
-
2009-11-23T09:29:23+01:00 (commit #4c9cf4e)
Author: Sebastian Bergmann (sb@sebastian-bergmann.de) / Commiter: Sebastian Bergmann (sb@sebastian-bergmann.de)
Initial work on PHP_CodeCoverage migration.
-
2009-08-27T10:37:36+02:00 (commit #c978d03)
Author: Sebastian Bergmann (sb@sebastian-bergmann.de) / Commiter: Sebastian Bergmann (sb@sebastian-bergmann.de)
Merge [5134].
-
2009-07-30T12:14:54+02:00 (commit #5d521f2)
Author: Sebastian Bergmann (sb@sebastian-bergmann.de) / Commiter: Sebastian Bergmann (sb@sebastian-bergmann.de)
Merge [5028:5031] and [5039:5040].
-
2008-12-31T10:26:51+01:00 (commit #a899cb2)
Author: Sebastian Bergmann (sb@sebastian-bergmann.de) / Commiter: Sebastian Bergmann (sb@sebastian-bergmann.de)
Merge [4402].
-
2008-12-31T10:25:57+01:00 (commit #4b26cea)
Author: Sebastian Bergmann (sb@sebastian-bergmann.de) / Commiter: Sebastian Bergmann (sb@sebastian-bergmann.de)
Bump copyright year.
-
2007-12-26T19:11:55+01:00 (commit #1bba1cc)
Author: Sebastian Bergmann (sb@sebastian-bergmann.de) / Commiter: Sebastian Bergmann (sb@sebastian-bergmann.de)
Bump copyright year.
-
2007-12-26T19:11:04+01:00 (commit #58121cf)
Author: Sebastian Bergmann (sb@sebastian-bergmann.de) / Commiter: Sebastian Bergmann (sb@sebastian-bergmann.de)
Bump copyright year.
-
2007-07-11T09:55:34+02:00 (commit #0b9d507)
Author: Sebastian Bergmann (sb@sebastian-bergmann.de) / Commiter: Sebastian Bergmann (sb@sebastian-bergmann.de)
Merge [766].
-
2007-02-24T07:58:18+01:00 (commit #203ee10)
Author: Sebastian Bergmann (sb@sebastian-bergmann.de) / Commiter: Sebastian Bergmann (sb@sebastian-bergmann.de)
Fugbix typo.
-
2007-02-24T07:58:18+01:00 (commit #ae2a7c2)
Author: Sebastian Bergmann (sb@sebastian-bergmann.de) / Commiter: Sebastian Bergmann (sb@sebastian-bergmann.de)
Fugbix typo.
-
2007-02-02T10:01:13+01:00 (commit #05c5fa7)
Author: Sebastian Bergmann (sb@sebastian-bergmann.de) / Commiter: Sebastian Bergmann (sb@sebastian-bergmann.de)
Also handle E_NOTICE and E_STRICT.
-
2007-01-13T10:16:49+01:00 (commit #a49ea01)
Author: Sebastian Bergmann (sb@sebastian-bergmann.de) / Commiter: Sebastian Bergmann (sb@sebastian-bergmann.de)
Leftovers from [176] and [265]. Reported by Douglas E. Warner <silfreed@silfreed.net>.
-
2006-12-24T18:50:40+01:00 (commit #0189be1)
Author: Sebastian Bergmann (sb@sebastian-bergmann.de) / Commiter: Sebastian Bergmann (sb@sebastian-bergmann.de)
Bump year.
-
2006-09-11T09:20:41+02:00 (commit #75e12fb)
Author: Sebastian Bergmann (sb@sebastian-bergmann.de) / Commiter: Sebastian Bergmann (sb@sebastian-bergmann.de)
No longer needed.
-
2006-08-13T10:57:58+02:00 (commit #3cd6a25)
Author: Sebastian Bergmann (sb@sebastian-bergmann.de) / Commiter: Sebastian Bergmann (sb@sebastian-bergmann.de)
Whitespace fixes.
-
2006-07-06T11:50:42+02:00 (commit #dacd2f1)
Author: Sebastian Bergmann (sb@sebastian-bergmann.de) / Commiter: Sebastian Bergmann (sb@sebastian-bergmann.de)
Leftover: PHPUnit2 -> PHPUnit.
-
2006-06-30T10:38:41+02:00 (commit #210b621)
Author: Sebastian Bergmann (sb@sebastian-bergmann.de) / Commiter: Sebastian Bergmann (sb@sebastian-bergmann.de)
Make it easier to use a checkout of the trunk.
-
2006-06-29T20:56:08+02:00 (commit #6b0d2d5)
Author: Sebastian Bergmann (sb@sebastian-bergmann.de) / Commiter: Sebastian Bergmann (sb@sebastian-bergmann.de)
Post-PEAR cleanup, phase one: PHPUnit2_* -> PHPUnit_*, pear.php.net -> phpunit.de, etc.
-
2006-06-29T16:58:01+02:00 (commit #8b8c705)
Author: Sebastian Bergmann (sb@sebastian-bergmann.de) / Commiter: Sebastian Bergmann (sb@sebastian-bergmann.de)
Recreate trunk.