3 // +------------------------------------------------------------------------+
5 // +------------------------------------------------------------------------+
6 // | Copyright (c) 2002-2003 Sebastian Bergmann <sb@sebastian-bergmann.de>. |
7 // +------------------------------------------------------------------------+
8 // | This source file is subject to version 3.00 of the PHP License, |
9 // | that is available at http://www.php.net/license/3_0.txt. |
10 // | If you did not receive a copy of the PHP license and are unable to |
11 // | obtain it through the world-wide-web, please send a note to |
12 // | license@php.net so we can mail you a copy immediately. |
13 // +------------------------------------------------------------------------+
15 // $Id: TestFailure.php,v 1.8 2004/10/01 06:11:39 sebastian Exp $
19 * A TestFailure collects a failed test together with the caught exception.
21 * @author Sebastian Bergmann <sb@sebastian-bergmann.de>
22 * @copyright Copyright © 2002-2004 Sebastian Bergmann <sb@sebastian-bergmann.de>
23 * @license http://www.php.net/license/3_0.txt The PHP License, Version 3.0
27 class PHPUnit_TestFailure
{
38 var $_thrownException;
41 * Constructs a TestFailure with the given test and exception.
47 function PHPUnit_TestFailure(&$failedTest, &$thrownException) {
48 $this->_failedTest
= $failedTest;
49 $this->_thrownException
= $thrownException;
53 * Gets the failed test.
58 function &failedTest() {
59 return $this->_failedTest
;
63 * Gets the thrown exception.
68 function &thrownException() {
69 return $this->_thrownException
;
73 * Returns a short description of the failure.
80 "TestCase %s->%s() failed: %s\n",
82 get_class($this->_failedTest
),
83 $this->_failedTest
->getName(),
84 $this->_thrownException