2 /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
7 * LICENSE: This source file is subject to version 3.0 of the PHP license
8 * that is available through the world-wide-web at the following URI:
9 * http://www.php.net/license/3_0.txt. If you did not receive a copy of
10 * the PHP License and are unable to obtain it through the web, please
11 * send a note to license@php.net so we can mail you a copy immediately.
15 * @author Sebastian Bergmann <sb@sebastian-bergmann.de>
16 * @copyright 2002-2005 Sebastian Bergmann <sb@sebastian-bergmann.de>
17 * @license http://www.php.net/license/3_0.txt PHP License 3.0
19 * @link http://pear.php.net/package/PHPUnit
20 * @since File available since Release 1.0.0
24 * A TestFailure collects a failed test together with the caught exception.
28 * @author Sebastian Bergmann <sb@sebastian-bergmann.de>
29 * @copyright 2002-2005 Sebastian Bergmann <sb@sebastian-bergmann.de>
30 * @license http://www.php.net/license/3_0.txt PHP License 3.0
31 * @version Release: @package_version@
32 * @link http://pear.php.net/package/PHPUnit
33 * @since Class available since Release 1.0.0
35 class PHPUnit_TestFailure {
46 var $_thrownException;
49 * Constructs a TestFailure with the given test and exception.
55 function PHPUnit_TestFailure(&$failedTest, &$thrownException) {
56 $this->_failedTest = &$failedTest;
57 $this->_thrownException = &$thrownException;
61 * Gets the failed test.
66 function &failedTest() {
67 return $this->_failedTest;
71 * Gets the thrown exception.
76 function &thrownException() {
77 return $this->_thrownException;
81 * Returns a short description of the failure.
88 "TestCase %s->%s() failed: %s\n",
90 get_class($this->_failedTest),
91 $this->_failedTest->getName(),
92 $this->_thrownException
101 * c-hanging-comment-ender-p: nil