Strange behaviour with exception blocks
| From: | Sebastian Bergmann | Date: | Fri, 30 Jan 2004 16:58:09 +0000 |
| Subject: | Strange behaviour with exception blocks | ||
| Groups: | php.internals | ||
| Request: | Send a blank email to internals+get-7426@lists.php.net to get a copy of this message | ||
The following code
public function run(PHPUnit_Framework_Test $test) {
print_r($test);
$this->startTest($test);
print_r($test);
try {
$test->runBare();
}
catch (PHPUnit_Framework_AssertionFailedError $e) {
$this->addFailure($test, $e);
}
catch (Exception $e) {
$this->addError($test, $e);
}
print_r($test);
$this->endTest($test);
}
prints
PHPUnit_Tests_Framework_AssertTest Object
(
[codeCoverageInformation:private] => Array
(
)
[name:private] => testFail
)
PHPUnit_Tests_Framework_AssertTest Object
(
[codeCoverageInformation:private] => Array
(
)
[name:private] => testFail
)
PHPUnit_Tests_Framework_AssertTest Object
(
[codeCoverageInformation:private] => Array
(
)
[name:private] => testfail
)
aus.
After the try{}/catch{} the [name:private] is lower-cased.
--
Sebastian Bergmann
http://sebastian-bergmann.de/ http://phpOpenTracker.de/
Das Buch zu PHP 5: http://professionelle-softwareentwicklung-mit-php5.de/